◐ Shell
clean mode source ↗

Message 131551 - Python tracker

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.