🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@note35
Copy link
Contributor

@note35 note35 commented Dec 11, 2025

Test with

  1. ./python -m test test_interpreters test_struct
  2. ./python -m test test_interpreters test_concurrent_futures.test_interpreter_pool

self.assertStartsWith(self.executor.submit(get_thread_name).result(),
"InterpreterPoolExecutor-"[:15])

def test_cross_interpreter_unbound_identity(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI @ZeroIntensity This test will fail if we make the UNBOUND an object().

Copy link
Member

Choose a reason for hiding this comment

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

What is this testing for? _queues.UNBOUND is not a public interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's defined under __all__, I guess it's okay to use?

__all__ = [
    'UNBOUND', 'UNBOUND_ERROR', 'UNBOUND_REMOVE',
    'create', 'list_all',
    'Queue',
    'QueueError', 'QueueNotFoundError', 'QueueEmpty', 'QueueFull',
    'ItemInterpreterDestroyed',
]

This test verifies the object is consistent across interpreters.

Copy link
Member

Choose a reason for hiding this comment

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

It's defined under __all__, but as far as I can tell, it's not exported to concurrent.interpreters, so the only way to access it is through the private API.

Generally speaking, I believe UNBOUND is supposed to be a sentinel that doesn't need a consistent state across interpreters. Do you have a case in mind where it would be useful to share UNBOUND?

We don't need to make singleton picklabe based on the current tests.
@note35 note35 force-pushed the gh-142414-singleton-removal branch from 2b1d0f1 to b128769 Compare December 11, 2025 16:07
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