[Python-Dev] RE: [Python-checkins] python/dist/src/Objects typeobject.c, 2.244, 2.245
Armin Rigo
arigo at tunes.org
Fri Oct 24 08:46:06 EDT 2003
More information about the Python-Dev mailing list
Fri Oct 24 08:46:06 EDT 2003
- Previous message: [Python-Dev] How to spell Py_return_None and friends (was: RE: [Python-checkins] python/dist/src/Objects typeobject.c, 2.244, 2.245)
- Next message: [Python-Dev] RE: [Python-checkins] python/dist/src/Objects typeobject.c, 2.244, 2.245
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello Guido, On Wed, Oct 08, 2003 at 08:45:45PM -0700, Guido van Rossum wrote: > Py_INCREF(Py_True); > return Py_True; > > takes less time than > > return PyBool_FromLong(1); > > Maybe a pair of macros Py_return_True and Py_return_False would make > sense? Sorry if this was already suggested and hastily rejected, but why do we care at all about the reference counter of the few heavily-used immortal objects of CPython? I guess allowing their counter not to be carefully maintained ventures to the slippery slopes of bad code. Anyway, my two cents for a (very) slightly faster and shorter code would be to be allowed never to do Py_INCREF or Py_DECREF when we know that the object is Py_None, Py_False or Py_True. These three would have a dummy tp_dealloc that just resets the reference counter to some large value if it ever reaches zero. Armin
- Previous message: [Python-Dev] How to spell Py_return_None and friends (was: RE: [Python-checkins] python/dist/src/Objects typeobject.c, 2.244, 2.245)
- Next message: [Python-Dev] RE: [Python-checkins] python/dist/src/Objects typeobject.c, 2.244, 2.245
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list