Inconsistency between dict() and collections.OrderedDict() methods.
Gregory Ewing
greg.ewing at canterbury.ac.nz
Sun Apr 30 02:52:33 EDT 2017
Erik wrote:
> Is there not a class that is somewhere between "dict" and "OrderedDict"
> that provides what I need?
Such a class could exist, but the stdlib doesn't happen to provide
one as far as I know.
Note, though, that you're relying on implementation details of
OrderedDict when you use it to "fix" your problem in this way.
It happens to work in some versions of Python, but it might not
work in the next one.
> OK, so technically it is a subclass, I didn't notice that, but where
> does the documentation explain all of the differences in behaviour?
It doesn't, but the differences you're talking about are differences
between undocumented behavour of dict and undocumented behaviour
of OrderedDict. The docs are under no obligation to tell you about any
of that.
--
Greg
More information about the Python-list
mailing list