[Python-ideas] `OrderedDict.items().__getitem__`
Chris Angelico
rosuav at gmail.com
Sat Jan 11 23:53:36 CET 2014
On Sun, Jan 12, 2014 at 9:32 AM, Mark Lawrence <breamoreboy at yahoo.co.uk> wrote:
> Surely a shallow copy isn't guaranteed to work properly in all cases anyway?
>
> copy(...)
> D.copy() -> a shallow copy of D
A shallow copy is sufficient if it's about to mutate the dictionary
itself (popitem). It's the right semantics... just the wrong
complexity, as it's expensive on large dictionaries :)
ChrisA
More information about the Python-ideas
mailing list