Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1f2128f + e885d71 commit 2bc135fCopy full SHA for 2bc135f
src/8/implementing_custom_containers/example1.py
@@ -5,7 +5,7 @@
5
6
class SortedItems(collections.Sequence):
7
def __init__(self, initial=None):
8
- self._items = sorted(initial) if initial is None else []
+ self._items = sorted(initial) if initial is not None else []
9
10
# Required sequence methods
11
def __getitem__(self, index):
src/8/implementing_custom_containers/example2.py
@@ -2,7 +2,7 @@
2
3
class Items(collections.MutableSequence):
4
- self._items = list(initial) if initial is None else []
+ self._items = list(initial) if initial is not None else []
0 commit comments