Debian Codegraph @

rpython/translator/goal/targettestlistvsdict.py

raw symbols SCIP
1 """
2 A simple standalone target.
3
4 The target below specifies None as the argument types list.
5 This is a case treated specially in driver.py . If the list
6 of input types is empty, it is meant to be a list of strings,
7 actually implementing argv of the executable.
8 """
9
10 import os, sys
11
12 def debug(msg):
13 os.write(2, "debug: " + msg + '\n')
14
15 # __________ Entry point __________
16
17 numbers = range(1000, 5000)
18 test_list = map(str, numbers)
19 test_dict = dict(map(lambda x: (x, str(x)), numbers))
20
21 def entry_point(argv):
22 if argv[1] == 'd':
23 print test_dict[int(argv[2])]
24 else:
25 print test_list[int(argv[2])]
26 return 0
27
28 # _____ Define and setup target ___
29
30 def target(*args):
31 return entry_point, None