Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Feature or enhancement
I propose adding a new function to thesys module to check if the GIL is current enabled:
sys._is_gil_enabled() -> boolReturn True if the GIL is currently enabled and False if the GIL is currently disabled.The function would always returnTrue 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