-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-142414: Unify UNBOUND in Lib/concurrent/interpreters/_queues.py and Lib/concurrent/interpreters/_crossinterp.py. #142515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
||
|
|
||
| UNBOUND = _crossinterp.UnboundItem.singleton('queue', __name__) | ||
| _crossinterp.register_unbound(UNBOUND, 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to import "3" from _crossinterp.py?
ZeroIntensity
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| UNBOUND = _crossinterp.UnboundItem.singleton('queue', __name__) | ||
| _crossinterp.register_unbound(UNBOUND, 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems very hacky. Couldn't we just import UNBOUND from _crossinterp and directly use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can pass the test too.
I made a commit with this suggestion.
I am not sure the intention of a BOUND definition in _queues before, I guess a better repr? (But likely not needed?)
The fix is aligned with bug reporter's observation.
Test with
./python -m test test_interpreters test_struct./python -m test test_interpreters test_structfails with: KeyError: concurrent.interpreters._queues.UNBOUND #142414