Message131551
| Author |
rhettinger |
| Recipients |
Trundle, daniel.urban, eric.araujo, ncoghlan, pitrou, rhettinger |
| Date |
2011年03月20日.21:55:22 |
| SpamBayes Score |
7.7123497e-07 |
| Marked as misclassified |
No |
| Message-id |
<1300658123.02.0.849113821695.issue10977@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I'm just pointing out a problem. Lots of existing code uses the concrete API and that code can break subclasses of builtin types (possibly resulting in segfaults).
I don't really care what is done about it. I'm just observing that the current design of the concrete API is incompatible with subclassing of built-in types.
A practical consequence is that I don't see how to write a fast, light C version of OrderedDict that would be safe from calls to PyDict_SetItem(). AFAICT, there is no mechanism for adding extra state to a built-in type and being able to guarantee even very simple invariants. |
|