Chris Angelico writes: > I would pick repeatedly from the same dictionary but it might be > mutated in between. So the list would have to be reconstructed > fresh every time.
OK, that moves me a couple million Planck lengths away from -1 nm. :-) I guess in that case if I cared about performance of both dict and sequence access, I would use a derived type with the actual data store being a list, and a dict storing the index (this was suggested to the OP, IIRC). If I really, *really*, REALLY cared about performance I'd write an accelerated module (eg, in C for CPython)[1], and take advantage of special characteristics of my application. WDYT? Footnotes: [1] Okay, I've done that for XEmacs, though not yet for Python. So that's probably not something I could recommend to typical Pythonistas. _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/45DIZOVUO2RJJ7RD653HSOSGDAFYYYZM/ Code of Conduct: http://python.org/psf/codeofconduct/