[Python-Dev] [Python-checkins] cpython: Issue #11223: Add threading._info() function providing informations about the (original) (raw)

Benjamin Peterson benjamin at python.org
Wed Apr 20 18:57:38 CEST 2011


2011/4/20 Victor Stinner <victor.stinner at haypocalc.com>:

Le mercredi 20 avril 2011 à 20:24 +1000, Nick Coghlan a écrit :

On Wed, Apr 20, 2011 at 6:20 PM, Victor Stinner <victor.stinner at haypocalc.com> wrote: > Hi, > > Le mardi 19 avril 2011 à 22:42 -0400, Terry Reedy a écrit : >> On 4/19/2011 5:59 PM, victor.stinner wrote: >> >> >    Issue #11223: Add threading.info() function providing informations about the >> > thread implementation. >> >> Since this is being documented, making it part of the public api, why >> does it have a leading underscore? > > Well, I suppose that this function might be specific to CPython. Do you > think that this function can/should be implemented in PyPy, Jython and > IronPython?

I agree with your reasoning (and the leading underscore), but I suggest marking the docs with the implementation detail flag. I chose to return a dict to be flexible: any thread implementation may add new specific keys. There is just one mandatory key: 'name', name of the thread implementation (nt, os2, pthread or solaris for CPython 3.3).

How about using a structseq ala sys.float_info or sys.long_info? (In fact, we might want to put this in sys.)

-- Regards, Benjamin



More information about the Python-Dev mailing list