On Thu, Jul 9, 2020, at 13:26, Stestagg wrote: > Obviously, python is a general-purpose, turing complete language, so > each of these options can be written in other ways. But it would be > nice if the simple, readable versions also worked :D > > The idea that there are future, unspecified changes to dicts() that may > or may not be hampered by allowing indexing sounds like FUD to me, > unless there are concrete references?
Does the current implementation support indexing? It is certainly possible in principle to preserve ordering without indexing, for example if a linked list is used to support the ordering, or if items are stored in an array where deleted items leave holes permanently until the dict is resized. I don't know how dict works, but I am not sure how you would support indexing while also allowing deletion to be O(1). A specific random key function would be narrower in scope than this, and for anyone who wants full sequence support, perhaps that could be added to OrderedDict. _______________________________________________ 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/66KEODX2EPDIN5K4Y72DRRUW432V3O3S/ Code of Conduct: http://python.org/psf/codeofconduct/
