4 ms·
What's the point of named arguments if you can't do something like the following (e.g. Python)? >>> def some_func(a=1, b=2, c=3): return (a + b) *
by RyanMcGreal 16y ago
What's the point of named arguments if you can't do something like the following (e.g. Python)?
>>> def some_func(a=1, b=2, c=3):
return (a + b) * c
>>> val1 = some_func()
>>> val1
9
>>> val2 = some_func(b=3)
>>> val2
12
>>> val3 = some_func(c=5)
>>> val3
15
>>>
- nuclear_eclipse 16y agoI completely agree with you, and I much prefer Python's method of handling it. I was at explaining why PHP acts the way it does.
- RyanMcGreal 16y agoYes, of course. I wasn't holding you responsible. :)