2017-02-15 00:57:56 +03:00
|
|
|
try:
|
|
|
|
enumerate
|
|
|
|
except:
|
|
|
|
print("SKIP")
|
2017-06-10 20:03:01 +03:00
|
|
|
raise SystemExit
|
2017-02-15 00:57:56 +03:00
|
|
|
|
2014-01-15 03:55:01 +04:00
|
|
|
print(list(enumerate([])))
|
|
|
|
print(list(enumerate([1, 2, 3])))
|
|
|
|
print(list(enumerate([1, 2, 3], 5)))
|
|
|
|
print(list(enumerate([1, 2, 3], -5)))
|
2016-02-13 02:38:30 +03:00
|
|
|
print(list(enumerate(range(100))))
|
2014-01-15 03:55:01 +04:00
|
|
|
|
2014-05-06 20:38:54 +04:00
|
|
|
# specifying args with keywords
|
|
|
|
print(list(enumerate([1, 2, 3], start=1)))
|
|
|
|
print(list(enumerate(iterable=[1, 2, 3])))
|
|
|
|
print(list(enumerate(iterable=[1, 2, 3], start=1)))
|
2018-03-08 04:50:07 +03:00
|
|
|
|
|
|
|
# check handling of extra positional args (exercises some logic in mp_arg_parse_all)
|
|
|
|
# don't print anything because it doesn't error with MICROPY_CPYTHON_COMPAT disabled
|
|
|
|
try:
|
|
|
|
enumerate([], 1, 2)
|
|
|
|
except TypeError:
|
|
|
|
pass
|