8000
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 9413cc3 commit 371020eCopy full SHA for 371020e
future/builtins/types/newlist.py
@@ -67,7 +67,12 @@ def __radd__(self, left):
67
return NotImplemented
68
69
def __getitem__(self, y):
70
- """x.__getitem__(y) <==> x[y]"""
+ """
71
+ x.__getitem__(y) <==> x[y]
72
+
73
+ Warning: a bug in Python 2.x prevents indexing via a slice from
74
+ returning a newlist object.
75
76
if isinstance(y, slice):
77
return newlist(super(newlist, self).__getitem__(y))
78
else:
@@ -79,5 +84,8 @@ def __native__(self):
79
84
"""
80
85
return list(self)
81
86
87
+ def __nonzero__(self):
88
+ return len(self) > 0
89
82
90
83
91
__all__ = ['newlist']
0 commit comments