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.
1 parent 8a71861 commit e885d71Copy full SHA for e885d71
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