native_enum: add capsule containing enum information and cleanup logic (#5871)

* native_enum: add capsule containing enum information and cleanup logic

* style: pre-commit fixes

* Updates from code review

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Joshua Oreman
2025-10-18 13:07:00 -04:00
committed by GitHub
parent 15943963b3
commit e6984c805e
8 changed files with 174 additions and 52 deletions

View File

@@ -24,6 +24,12 @@ PY_GIL_DISABLED = bool(sysconfig.get_config_var("Py_GIL_DISABLED"))
# Runtime state (what's actually happening now)
sys_is_gil_enabled = getattr(sys, "_is_gil_enabled", lambda: True)
TYPES_ARE_IMMORTAL = (
PYPY
or GRAALPY
or (CPYTHON and PY_GIL_DISABLED and (3, 13) <= sys.version_info < (3, 14))
)
def deprecated_call():
"""