Greg Ewing wrote:
> Jim Jewett wrote:
>
>> I also see the value of keyword-only arguments without unlimited
>> positional arguments. Whether it deserves syntax and what that syntax
>> should be (such as * or *None) may need a pronouncement eventually,
>> but it doesn't have to be complex.
>
> My previous post was just wild brainstorming. I'd be
> perfectly happy with
>
> def f(a, b, *, c, d = x):
> # c and d are keyword only, c is required,
> # no extra positional args allowed
Or just ...
def f(a, b, c=?, d=x):
I think this might be clearer if some suitable replacement for the '?'
in the above could be decided on.
This *may* relate to None being an object which isn't the same as "not a
value". There currently isn't a way (that I know of) to specify a
generally null object outside of sequences.
def f(a, b, c=Null, d=x): # Using None here wouldn't work.
Recently I found a case where I wanted to return something that was more
literally *nothing* than a None is. So maybe a null symbol of some sort
might be useful in other cases as well?
Cheers,
Ron
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com