[Python-Dev] [Python-checkins] python/dist/src/Modules _csv.c, 1.37, 1.38

Michael Hudson mwh at python.net
Wed Jun 15 16:26:00 CEST 2005


Armin Rigo <arigo at tunes.org> writes:

> Hi Skip,
>
> On Wed, Jun 15, 2005 at 06:35:10AM -0700, montanaro at users.sourceforge.net wrote:
>> Why this worked is a bit mystical.  Perhaps it never gets freed because the
>> object just happens never to be DECREF'd (but that seems unlikely).
>>          /* Add the Dialect type */
>> +	Py_INCREF(&Dialect_Type);
>>          if (PyModule_AddObject(module, "Dialect", (PyObject *)&Dialect_Type))
>>                  return;
>
> Hum, you probably don't want to know, but it works just fine to forget
> a Py_INCREF before PyModule_AddObject() for the following reason:

No, it's more complicated than that, at least in an embedded
scenario (see bug #1220756).

I don't understand how thread._local differed from _cvs.Dialect,
though.

Cheers,
mwh

-- 
  faassen: anyway, if nothing else flapping your arms running around 
           will at least give an impression of activity. :)


More information about the Python-Dev mailing list