On Sun, 10 Oct 2021 at 05:06, Finn Mason <[email protected]> wrote: > > Let's get back to the original topic. Should `dict.items()` be indexable now > that dicts are ordered? I say yes. Why shouldn't it?
I say no. "Why shouldn't it?" isn't sufficient justification for a change. Because it costs someone time and effort to implement it, and that time and effort is wasted unless people *actually use it*. Because no convincing use cases have been presented demonstrating that it would improve real-world code. Because dictionaries (mappings) and lists (sequences) are intended for different purposes. Because no-one is willing to implement this idea. Consider: "Should lists be indexable by arbitrary values, not just by integers? I say yes. Why shouldn't they?" "Should tuples be mutable? I say yes. Why shouldn't they?" "Should integers be allowed to have complex parts? I say yes. Why shouldn't they?" It's up to the person proposing a change to explain why the change *should* happen - not to everyone else to have to explain why it shouldn't. Paul _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/DXHJHW2WWXUILG3YVZPRNEEHNNG3OFWY/ Code of Conduct: http://python.org/psf/codeofconduct/
