mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
merge
This commit is contained in:
commit
a67619ec5f
2 changed files with 9 additions and 2 deletions
|
@ -189,6 +189,7 @@ class OrderedDict(dict):
|
||||||
link = self.__map[key]
|
link = self.__map[key]
|
||||||
link_prev = link.prev
|
link_prev = link.prev
|
||||||
link_next = link.next
|
link_next = link.next
|
||||||
|
soft_link = link_next.prev
|
||||||
link_prev.next = link_next
|
link_prev.next = link_next
|
||||||
link_next.prev = link_prev
|
link_next.prev = link_prev
|
||||||
root = self.__root
|
root = self.__root
|
||||||
|
@ -196,12 +197,14 @@ class OrderedDict(dict):
|
||||||
last = root.prev
|
last = root.prev
|
||||||
link.prev = last
|
link.prev = last
|
||||||
link.next = root
|
link.next = root
|
||||||
last.next = root.prev = link
|
root.prev = soft_link
|
||||||
|
last.next = link
|
||||||
else:
|
else:
|
||||||
first = root.next
|
first = root.next
|
||||||
link.prev = root
|
link.prev = root
|
||||||
link.next = first
|
link.next = first
|
||||||
root.next = first.prev = link
|
first.prev = soft_link
|
||||||
|
root.next = link
|
||||||
|
|
||||||
def __sizeof__(self):
|
def __sizeof__(self):
|
||||||
sizeof = _sys.getsizeof
|
sizeof = _sys.getsizeof
|
||||||
|
|
|
@ -51,6 +51,10 @@ Library
|
||||||
- Issue #13051: Fixed recursion errors in large or resized
|
- Issue #13051: Fixed recursion errors in large or resized
|
||||||
curses.textpad.Textbox. Based on patch by Tycho Andersen.
|
curses.textpad.Textbox. Based on patch by Tycho Andersen.
|
||||||
|
|
||||||
|
- Issue #29119: Fix weakrefs in the pure python version of
|
||||||
|
collections.OrderedDict move_to_end() method.
|
||||||
|
Contributed by Andra Bogildea.
|
||||||
|
|
||||||
- Issue #9770: curses.ascii predicates now work correctly with negative
|
- Issue #9770: curses.ascii predicates now work correctly with negative
|
||||||
integers.
|
integers.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue