Skip to content

Conversation

@note35
Copy link
Contributor

@note35 note35 commented Dec 10, 2025

The fix is aligned with bug reporter's observation.

Test with

  1. ./python -m test test_interpreters test_struct
  2. Repro script by Victor.



UNBOUND = _crossinterp.UnboundItem.singleton('queue', __name__)
_crossinterp.register_unbound(UNBOUND, 3)
Copy link
Contributor Author

@note35 note35 Dec 10, 2025

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?

Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a news entry, please add one. You can use blurb-it or the blurb command-line tool.

Comment on lines 49 to 50
UNBOUND = _crossinterp.UnboundItem.singleton('queue', __name__)
_crossinterp.register_unbound(UNBOUND, 3)
Copy link
Member

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?

Copy link
Contributor Author

@note35 note35 Dec 10, 2025

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?)

@note35 note35 changed the title gh-142414: Add register_unbound in _crossinterp.py and initialize it in _queues.py gh-142414: Align UNBOUND in Lib/concurrent/interpreters/_queues.py and Lib/concurrent/interpreters/_crossinterp.py. Dec 10, 2025
@note35 note35 requested a review from ZeroIntensity December 10, 2025 15:29
@note35 note35 changed the title gh-142414: Align UNBOUND in Lib/concurrent/interpreters/_queues.py and Lib/concurrent/interpreters/_crossinterp.py. gh-142414: Unify UNBOUND in Lib/concurrent/interpreters/_queues.py and Lib/concurrent/interpreters/_crossinterp.py. Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants