Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

> Overall, I expect the improved sharing to more than
> compensate for the disadvantages.

I expect the opposite.  This makes all dicts pay a price (in space, 
initialization time, and complexity) for a micro-optimization of an uncommon 
case (the normal case is for __init__ to run and set all the keys in a 
consistent order).  It is unlikely that the "benefits" to never be felt in 
real-word applications, but "disadvantages" would affect every Python program.

> The language specification says that the dicts maintain insertion 
> order, but the wording implies that this only to explicit 
> dictionaries, not instance attribute or other namespace dicts.

That is a quite liberal reading of the spec.  I would object to making instance 
and namespace dicts behave differently.  That would be a behavior regression 
and we would forever have to wrestle with the difference.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40116>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to