This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients brett.cannon, eric.snow, grahamd, ncoghlan, serhiy.storchaka, steve.dower
Date 2016-12-30.22:43:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> What do you think about resetting the counter back to 1 in Py_Initialize?

Sounds good to me.  When I was working on the patch I had the idea in the back of my mind that not resetting the counter would better support interpreter separation efforts in the future.  However, after giving it some thought I don't think that's the case.  So resetting it in Py_Initialize() is fine with me.

> I'll also note that in the threading module, the main thread is
> implicitly thread 0 (but named as MainThread) - Thread-1 is the first
> thread created via threading.Thread. So it may make sense to use a
> signed numeric ID, with 0 being the main interpreter, 1 being the first
> subinterpreter, and negative IDs being errors.

I had considered that and went with an unsigned long.  0 is used for errors, and starting at 1, which effectively means the main interpreter is always 1.  If we later run into overflow issues then we can sort that out at that point (e.g. by moving to a 64-bit int or even a Python int).

I'll add comments to the patch regarding these points.
Date User Action Args
2016-12-30 22:43:16eric.snowsetrecipients: + eric.snow, brett.cannon, ncoghlan, grahamd, serhiy.storchaka, steve.dower
2016-12-30 22:43:16eric.snowsetmessageid: <>
2016-12-30 22:43:16eric.snowlinkissue29102 messages
2016-12-30 22:43:16eric.snowcreate