Re: [Python-ideas] Positional only arguments

Aaron Brady wrote:
No
That's fine. 'a' is positional only and 'b' is either. Having defaults and being positional only are two different things. With the above function the following would be allowed. f() f(1) f(1, 2) f(1, b=2) f(b=2) But not: (If positional only also means no assignment with keywords at call time.) f(a=1) # Keyword not allowed for 'a' at call time. f(b=2, a=1) # 'a' is positional only
Looks ok to me. Even the error is correct.
Any more groups? So far I have pos-only, pos-or-kw, and kw-only.
If not, a ascii character works fine to delimit, like * and **.
Any character can possibly do it, but does it make sense given that they already have a meaning? I have a feeling we are trying to do too much at once. required optional with default with out default in order in order only with keyword with keyword only Can these be ordered into *any* decision tree that makes sense?
I think we should let Steven's decorator be developed further. It will at least give a way to test ideas and find more use cases. Then if there are some frequent and common use cases. Then look at what is actually needed. Cheers, Ron

On 22 May 2007, at 18:20, Ron Adam wrote:
No really that's too much: I don't deserve the credit. I only came up with the idea of the decorator (with an implementation) and provided a solution to the problem of keyword arguments with the same name as positional ones. So don't mention me :) -- Arnaud

On 22 May 2007, at 18:20, Ron Adam wrote:
No really that's too much: I don't deserve the credit. I only came up with the idea of the decorator (with an implementation) and provided a solution to the problem of keyword arguments with the same name as positional ones. So don't mention me :) -- Arnaud
participants (3)
-
Aaron Brady
-
Arnaud Delobelle
-
Ron Adam