|
|
|
|
|
by hermitdev
471 days ago
|
|
> Which is redundant for most functions as they only have positional parameters. Huh? This is not true. def foo(a, b, c): ...
This can be invoked as either `foo(1, 2, 3)` or `foo(c=3, b=2, a=1)`: >>> def foo(a, b, c):
... print(f"{a=}")
... print(f"{b=}")
... print(f"{c=}")
...
>>> foo(1, 2, 3)
a=1
b=2
c=3
>>> foo(c=3, b=2, a=1)
a=1
b=2
c=3
>>>
|
|