While I love this idea, and I think this PEP is bound for glory, I don't
love any of the proposed spellings for denoting late-binding arguments. It
seems to me that a specialized symbol combination indicating that a
particular argument has special behavior does not serve readability,
regardless of what symbol combination is chosen.

I would prefer to build on the fact that arguments already come in two
flavors with somewhat different behaviors, and that the ordering of these
is determined. Going by this analogy, it would make sense to have
late-binding arguments following keyword arguments, set off by some
separator, such as a double-pipe:

def my_func(positional_arg, some_kwarg="foo" || late_binding_arg=[]]:
    # body of func

or

def my_func(positional_arg, some_kwarg="foo" ||
            late_binding_arg=[]):
    # body of func

I'm not massively attached to this particular symbol (which has advantages
and disadvantages), but more to the idea that we can easily see that the
arguments to the right of it are late-binding, and we can easily teach a
beginner what that means.
We can also easily scan a function definition and know that there is some
specialized behavior going on, which is harder to see with a spelling like

def my_func(positional_arg, some_kwarg<="foo",
            another_kwarg=[]):
    # body of func

and we will probably even notice much more easily that there is a likely
bug in that last definition (since we probably meant for the list arg to be
late-binding)

Best
-Jon Kiparsky
jon.kipar...@gmail.com
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/BDWQD6OMSJZ3YM64QDRKYJCRWEDK3JNX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to