array indexing works now also with variables

This commit is contained in:
David Halter committed 2012-08-06 17:47:43 +02:00
1 parent 8780199a33
commit c154bdad0e
5 files changed
+56 -10

No files matched your search

+23
View File
@@ -139,6 +139,29 @@ dic2[r'asdf']
#? int() str()
dic2['just_something']
# -----------------
# with variable as index
# -----------------
a = (1, "")
index = 1
#? str()
a[index]
# these should just ouput the whole array
index = int
#? int() str()
a[index]
index = int()
#? int() str()
a[index]
# dicts
index = 'asdf'
dic2 = {'asdf': 3, 'b': 'str'}
#? int()
dic2[index]
# -----------------
# __getitem__
# -----------------