girving/numpy — comment on commit 730b05a892371d6f18d9317e5ae6dc306c0211b0
File:  line 0
By m-paradox:

I think this change requires some more discussion and thought, because while it is certainly a useful thing to enable, it breaks the intent I had in how I structured it.

My idea was to allow for the addition of multi-threading code which used this flag to determine whether it was ok to call the inner loop from a thread which is completely separate from the CPython API context. Based on what Mark Florisson has said on the mailing list (http://www.mail-archive.com/numpy-discussion@scipy.org/msg34459.html), this is incompatible with usage of PyGILState_Ensure/Release. A way to signal errors that will raise from the main Python thread is still missing from the idea, though.

Perhaps this change should go in, with an awareness that this is something to be broken for 2.0? It looks to me like the flag should be replaced with an enum choosing between holding the GIL, releasing the GIL but allowing PyGILState_Ensure/Release, and disallowing all calls to the CPython API.