On Tue, Nov 29, 2022 at 01:34:54PM +1300, Greg Ewing wrote:

> I got the impression that there were some internal language reasons
> to want stable dicts, e.g. so that the class dict passed to __prepare__
> preserves the order in which names are assigned in the class body. Are
> there any such use cases for stable sets?

Some people wanted order preserving kwargs, I think for web frameworks. 
There was even a discussion for a while about using OrderedDict for 
kwargs and leaving dicts unordered.

For me, the biggest advantage of preserving input order in dicts is that 
it is now easier to write doctests using the dict's repr. It would be 
nice to be able to do the same for sets, but not nice enough to justify 
making them bigger or slower.


-- 
Steve
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/5HWYYKDJLGDZT5IZIXM42EWF2WPFXKBJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to