mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Replace left(), right(), and __reversed__() with the more general purpose
__getitem__() and __setitem__(). Simplifies the API, reduces the code size, adds flexibility, and makes deques work with bisect.bisect(), random.shuffle(), and random.sample().
This commit is contained in:
parent
786ea6bc23
commit
0a4977c2f3
4 changed files with 110 additions and 148 deletions
|
|
@ -262,7 +262,7 @@ class fifo:
|
|||
return self.list == []
|
||||
|
||||
def first (self):
|
||||
return self.list.left()
|
||||
return self.list[0]
|
||||
|
||||
def push (self, data):
|
||||
self.list.append(data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue