micropython/tests/basics/fun-callstar.py
Damien George 7447e80f3d tests: Remove print('flush') from 2 tests, since stmhal now works.
Fixing the USB problem on stmhal now gets these 2 tests working.
2014-04-17 00:14:05 +01:00

34 lines
448 B
Python

# function calls with *pos
def foo(a, b, c):
print(a, b, c)
foo(*(1, 2, 3))
foo(1, *(2, 3))
foo(1, 2, *(3,))
foo(1, 2, 3, *())
# Another sequence type
foo(1, 2, *[100])
# Iterator
foo(*range(3))
# method calls with *pos
class A:
def foo(self, a, b, c):
print(a, b, c)
a = A()
a.foo(*(1, 2, 3))
a.foo(1, *(2, 3))
a.foo(1, 2, *(3,))
a.foo(1, 2, 3, *())
# Another sequence type
a.foo(1, 2, *[100])
# Iterator
a.foo(*range(3))