fix indexing issues for multiple index options

This commit is contained in:
Dave Halter
2014-06-27 11:23:46 +02:00
parent 4c849f5969
commit aba4a16ae3
7 changed files with 26 additions and 9 deletions

View File

@@ -276,6 +276,17 @@ class GetItem():
#? str()
GetItem("")[1]
class GetItemWithList():
def __getitem__(self, index):
return [1, 1.0, 's'][index]
#? float()
GetItemWithList()[1]
for i in 0, 2:
#? int() str()
GetItemWithList()[i]
# -----------------
# conversions
# -----------------

View File

@@ -12,6 +12,7 @@ sorted(arr)[0]
#? str()
next(reversed(arr))
next(reversed(arr))
# should not fail if there's no return value.
def yielder():