20 Sep
2012
20 Sep
'12
6:14 p.m.
2012/9/20 Mark Dickinson
And excepting optional ones, too, right? E.g., the c in
def foo(a, b, c=1, *args, d): pass
can be passed to by position, but isn't "positional".
Why not?
def f(a, b, c=3): pass ... f() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: f() missing 2 required positional arguments: 'a' and 'b' f(1, 2, 3, 4) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: f() takes from 2 to 3 positional arguments but 4 were given
-- Regards, Benjamin