Terry Reedy wrote:
On 3/2/2012 3:32 PM, Ethan Furman wrote:
Guido van Rossum wrote:
I would actually like to see a syntactic feature to state that an argument *cannot* be given as a keyword argument (just as we already added syntax to state that it *must* be a keyword).
I think this is what we need. I see the problem as being that a) C and Python functions work differently, and b) the doc does not -- and should not -- specify the implementation. One solution is to make all C functions work like Python functions. The other is to allow Python functions to work like C functions. Given the reasonable opposition to the first, we need the second.
So something like:
def ord(char, ?):
def split(self, char, ?, count)
def canary(breed, ?, color, wingspan, *, name)
That is probably better than using '$' or directly tagging the names.
I chose '?' because it has some similarity to an incompletely-drawn 'p', and also because it suggests a sort of vagueness, as in not being able to specify the name of the argument. I do not know if it is the best possible way, and am looking forward to other ideas. ~Ethan~