Conflicting documentation for -X gil compiler flag (3.13)

I noticed that in the “What’s New in Python 3.13” section for 3.13rc1, the documentation says

Free-threaded builds of CPython support optionally running with the GIL enabled at runtime using the environment variable PYTHON_GIL or the command-line option -X gil.

Whereas the documentation for the miscellaneous command line options reads:

-X gil=0,1 forces the GIL to be disabled or enabled, respectively.

That seems inconsistent to me. Do you need the equals sign and value or not?

The default is to run with the GIL, so -Xgil implies -Xgil=1. It would probably be a little clearer if the what’s new entry referred to it with the =0. I agree the truth value being inverted from what you usually expect - the default case is “on” - is a little confusing at first glance.

3 Likes

Well, if you want to talk about confusing command-line flags, --disable-gil should probably be --disablable-gil.

OK, thanks for the clarification!