By the way, this discussion is probably better suited to the Python-Ideas mailing list. But since we're here... On Tue, Nov 09, 2021 at 11:37:40AM +0100, Sebastian Rittau wrote:
To me, the "natural" solution looks like this:
def foo(x=None, y): ... [...]
Chris Angelico asked:
What would this mean, though:
foo(2)
Is that legal?
No. This would be equal to foo(x=2) (same as now), meaning the required argument "y" is missing.
That's an odd interpretation. What you described earlier is very similar to the calling convention of range, which conceptually looks like this: range([start=0,] end, [step=1]) With your example of "foo(x=None, y)" I would expect foo(2) to mean that x gets the default and y gets the passed in argument 2, similar to the way that range(2) works. -- Steve