mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
Trivial bug fix: deque == [] is not a good way to check if a deque is empty.
This commit is contained in:
parent
ffdb8bb99c
commit
b562bc672b
1 changed files with 1 additions and 1 deletions
|
|
@ -259,7 +259,7 @@ def __len__ (self):
|
|||
return len(self.list)
|
||||
|
||||
def is_empty (self):
|
||||
return self.list == []
|
||||
return not self.list
|
||||
|
||||
def first (self):
|
||||
return self.list[0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue