You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's unable to run with --executor interpreter because it hits oncurrent.futures.interpreter.ExecutionFailed: AttributeError: module '__main__' has no attribute 'pi'. The other two work. I'd assume this might be similar to how ProcessPoolExectuor handles __main__. Good to see there's already an issue, though, just dropping the script in case it's helpful.
The syncobj parameter in the PEP isn't really explained, and it doesn't even seem to be present:
Traceback (most recent call last):
File "/Users/henryschreiner/git/software/pybind11/concint.py", line 6, in <module>
tasks = concurrent.interpreters.create_queue(syncobj=True)
TypeError: create() got an unexpected keyword argument 'syncobj'
I'm currently just sticking an integer into a queue, and in main interpreter I'm getting concurrent.interpreters._queues.UNBOUND out. I was wondering if this was related, but it's not even present AFAICT. I see unbounditems= in the code, which maybe is a new name? Is the plan to update the PEP, or just rely on CPython docs?
Is there some way to copy the item so it can be accessed after the interpreter is destroyed? This is my demo code:
Indenting the final two lines fixes it, but curious if there's a way to get copies so I don't have to worry about the lifetimes, especially for things like integers.
It's unable to run with --executor interpreter because it hits oncurrent.futures.interpreter.ExecutionFailed: AttributeError: module 'main' has no attribute 'pi'. The other two work. I'd assume this might be similar to how ProcessPoolExectuor handles main. Good to see there's already an issue, though, just dropping the script in case it's helpful.
FYI, I just landed the key change here, which will be in beta 4. It should take care of the discrepancy between InterpreterPoolExecutor and the others.
The syncobj parameter in the PEP isn't really explained, and it doesn't even seem to be present:
Yeah, it's gone. I forgot to remove it from the PEP. I'll fix that.
Is there some way to copy the item so it can be accessed after the interpreter is destroyed? This is my demo code:
Objects belong to interpreters and an object cannot outlive the interpreter that created it.
Activity
henryiii commentedon Jun 18, 2025
I ran into this with the following example:
It's unable to run with
--executor interpreterbecause it hitsoncurrent.futures.interpreter.ExecutionFailed: AttributeError: module '__main__' has no attribute 'pi'. The other two work. I'd assume this might be similar to how ProcessPoolExectuor handles__main__. Good to see there's already an issue, though, just dropping the script in case it's helpful.henryiii commentedon Jun 18, 2025
The
syncobjparameter in the PEP isn't really explained, and it doesn't even seem to be present:I'm currently just sticking an integer into a queue, and in main interpreter I'm getting
concurrent.interpreters._queues.UNBOUNDout. I was wondering if this was related, but it's not even present AFAICT. I seeunbounditems=in the code, which maybe is a new name? Is the plan to update the PEP, or just rely on CPython docs?Is there some way to copy the item so it can be accessed after the interpreter is destroyed? This is my demo code:
Code:
Indenting the final two lines fixes it, but curious if there's a way to get copies so I don't have to worry about the lifetimes, especially for things like integers.
gh-133485: Use interpreters.Interpreter in InterpreterPoolExecutor (g…
pythongh-133485: Use interpreters.Interpreter in InterpreterPoolExecu…
ericsnowcurrently commentedon Jun 19, 2025
FYI, I just landed the key change here, which will be in beta 4. It should take care of the discrepancy between
InterpreterPoolExecutorand the others.Yeah, it's gone. I forgot to remove it from the PEP. I'll fix that.
Objects belong to interpreters and an object cannot outlive the interpreter that created it.
[3.14] gh-133485: Use interpreters.Interpreter in InterpreterPoolExec…
ericsnowcurrently commentedon Jun 19, 2025
The issues I knew of have been addressed. If there are any other specific inconsistencies (or bugs) then feel free to open a new issue.
ericsnowcurrently commentedon Jun 19, 2025
I've updated PEP 734: python/peps#4467.
pythongh-133485: Use interpreters.Interpreter in InterpreterPoolExecu…
pythongh-133485: Use interpreters.Interpreter in InterpreterPoolExecu…
pythongh-133485: Use interpreters.Interpreter in InterpreterPoolExecu…
pythongh-133485: Use interpreters.Interpreter in InterpreterPoolExecu…