Improve __all__ definitions for threading and _dummy_threading modules (#7135)

This commit is contained in:
Alex Waygood
2022-02-05 16:07:02 +00:00
committed by GitHub
parent bdef0a70a6
commit 348c38a0dd
7 changed files with 181 additions and 63 deletions

View File

@@ -8,7 +8,86 @@ _TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]]
_PF = Callable[[FrameType, str, Any], None]
_T = TypeVar("_T")
__all__: list[str]
if sys.version_info >= (3, 10):
__all__ = [
"get_ident",
"active_count",
"Condition",
"current_thread",
"enumerate",
"main_thread",
"TIMEOUT_MAX",
"Event",
"Lock",
"RLock",
"Semaphore",
"BoundedSemaphore",
"Thread",
"Barrier",
"BrokenBarrierError",
"Timer",
"ThreadError",
"setprofile",
"settrace",
"local",
"stack_size",
"excepthook",
"ExceptHookArgs",
"gettrace",
"getprofile",
"get_native_id",
]
elif sys.version_info >= (3, 8):
__all__ = [
"get_ident",
"active_count",
"Condition",
"current_thread",
"enumerate",
"main_thread",
"TIMEOUT_MAX",
"Event",
"Lock",
"RLock",
"Semaphore",
"BoundedSemaphore",
"Thread",
"Barrier",
"BrokenBarrierError",
"Timer",
"ThreadError",
"setprofile",
"settrace",
"local",
"stack_size",
"excepthook",
"ExceptHookArgs",
"get_native_id",
]
else:
__all__ = [
"get_ident",
"active_count",
"Condition",
"current_thread",
"enumerate",
"main_thread",
"TIMEOUT_MAX",
"Event",
"Lock",
"RLock",
"Semaphore",
"BoundedSemaphore",
"Thread",
"Barrier",
"BrokenBarrierError",
"Timer",
"ThreadError",
"setprofile",
"settrace",
"local",
"stack_size",
]
def active_count() -> int: ...
def activeCount() -> int: ... # deprecated alias for active_count()