PyDocs

Nav

Python Runtime Services

_jit.is_active

sys

function of _jit
  • _jit.is_active()
Return True if the topmost Python frame is currently executing JIT code (implies sys._jit.is_enabled()), and False otherwise.
1 Example
>>> for warmup in range(BIG_NUMBER):
...     # This line is "hot", and is eventually JIT-compiled:
...     if sys._jit.is_active():
...         # This line is "cold", and is run in the interpreter:
...         assert sys._jit.is_active()
...
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
    assert sys._jit.is_active()
           ~~~~~~~~~~~~~~~~~~^^
AssertionError
from the Python docs
See Also
No see-alsos for sys/_jit.is_active
0 Notes
No notes for _jit.is_active