Raymond Hettinger added the comment:
In general, it is not possible for a hypothetical StrictOrderedDict to know
whether its input was ordered or not. For the specific case of dict, it is
possible, but the general case is of course completely general (i.e. if the
input has a keys() method, the pairs are loaded with: for k in other.keys():
od[k] = other[k]). Those semantics are guaranteed.
Remember, Armin's core concept for OrderedDict was "to remember the order that
keys were added, the order is determined by whoever does the adding".
FWIW, the stackoverflow question was resolved trivially. The learning point is
perfectly general (i.e. it explains why you write Decimal('1.1') instead of
Decimal(1.1)).
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue19026>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com