mirror of
https://github.com/python/cpython.git
synced 2026-01-03 14:02:21 +00:00
Now that __keys are fully hidden, switch the underlying structure
to deque() which futher reduces the temptation to index or resort. Also, it is a bit faster for some cases.
This commit is contained in:
parent
0c9881782b
commit
89194ff280
1 changed files with 2 additions and 2 deletions
|
|
@ -27,11 +27,11 @@ def __init__(self, *args, **kwds):
|
|||
except AttributeError:
|
||||
# Note the underlying data structure for this class is likely to
|
||||
# change in the future. Do not rely on it or access it directly.
|
||||
self.__keys = []
|
||||
self.__keys = deque()
|
||||
self.update(*args, **kwds)
|
||||
|
||||
def clear(self):
|
||||
del self.__keys[:]
|
||||
self.__keys.clear()
|
||||
dict.clear(self)
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue