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 rhettinger
Recipients Trundle, benjamin.peterson, daniel.urban, docs@python, eric.araujo, ncoghlan, pitrou, rhettinger
Date 2011-04-06.22:22:21
SpamBayes Score 1.2712619e-08
Marked as misclassified No
Message-id <1302128542.41.0.206474137119.issue10977@psf.upfronthosting.co.za>
In-reply-to
Content
One thing that could be done is to have an optional warning in the mutating concrete C API functions that gets triggered whenever the input doesn't have an exact type match.  That will let people discover incorrect uses.

We could also scour our own stdlib code to see if there are any cases where there needs to be an alternate code patch for subclasses of builtin types.

I did a scan for PyList_SetItem and found that we were already pretty good about only using it when the target was known to be an exact list. Though those results were good, I'm not hopeful for a similar result with PyDict_SetItem.

In the mean time this bug will preclude a C version of OrderedDict from being a dict subclass.  That's unfortunate because it means that the C version can't be a drop-in replacement for the existing pure python OrderedDict.
History
Date User Action Args
2011-04-06 22:22:22rhettingersetrecipients: + rhettinger, ncoghlan, pitrou, benjamin.peterson, eric.araujo, Trundle, daniel.urban, docs@python
2011-04-06 22:22:22rhettingersetmessageid: <1302128542.41.0.206474137119.issue10977@psf.upfronthosting.co.za>
2011-04-06 22:22:21rhettingerlinkissue10977 messages
2011-04-06 22:22:21rhettingercreate