This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients Mark.Shannon, lemburg, methane, rhettinger, serhiy.storchaka
Date 2021-09-22.19:46:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <3db39bbf-ba98-b802-2a0a-b923e8cefaf3@egenix.com>
In-reply-to <1632337353.9.0.484296096357.issue40116@roundup.psfhosted.org>
Content
On 22.09.2021 21:02, Raymond Hettinger wrote:
>> 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.

I agree. Keeping the insertion order is essential for many common
use cases, including those where a class or instance dict is used,
e.g. namespaces used for data records, data caches, field
definitions in data records, etc. (and yes, those often can be
dynamically extended as well :-)).

I think for the case you mention, a documentation patch would be
better and more helpful for the programmers. Point them to slots
and the sharing problem should go away in most cases :-)
History
Date User Action Args
2021-09-22 19:46:34lemburgsetrecipients: + lemburg, rhettinger, methane, Mark.Shannon, serhiy.storchaka
2021-09-22 19:46:34lemburglinkissue40116 messages
2021-09-22 19:46:34lemburgcreate