-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
Description
Feature or enhancement
I propose adding a new function to the sys
module to check if the GIL is current enabled:
sys._is_gil_enabled() -> bool
Return True if the GIL is currently enabled and False if the GIL is currently disabled.
The function would always return True
in builds that do not support free-threading. In the free-threaded build, the the GIL might be dynamically enabled or disabled depending on imported modules.
EDIT: Changed name to use underscore prefix
Linked PRs
swtaarrs, JelleZijlstra, AlexWaygood, gpshead, graingert and 5 more