The shebang issue should probably lean on existing Python conventions:
from future import nogil
It would hot swap interpreters at that point.
from future import nogil
It would hot swap interpreters at that point.
https://docs.python.org/3/reference/simple_stmts.html#future...
future statements are module specific and GIL/no-GIL doesn't fit easily into that model.
https://peps.python.org/pep-0397/
But for all platforms. I should have put that into the comment.
try:
import nogil
except ImportError as ie:
print(ie)
nogil = None
if nogil:
# gill free code here
pass
else:
# gil requring code here
pass