[Python-ideas] Positional only arguments
Ron Adam
rrr at ronadam.com
Sun May 20 19:08:20 CEST 2007
George Sakkis wrote:
> On 5/20/07, Steven Bethard <steven.bethard at gmail.com> wrote:
>> On 5/19/07, Arnaud Delobelle <arno at marooned.org.uk> wrote:
>>> - How would this work with name mangling and methods? For example:
>>>
>>> class Foo(object):
>>> def posfun(__self, __a, b, ...):
>>>
>>> * Would self have to be renamed __self? (As positional only arguments
>>> should come first)
>> Yes.
>
> Ouch, hadn't thought of that. Many people find explicit self ugly, and
> now you'll tell them they *have to* spell it __self (or __s for fewer
> keystrokes) ? That's indeed ugly.
>
> The semicolon proposal looks better, at least for this case:
>
> class Foo(object):
> def posfun(self, a; b, ...):
I would also say identifying the semicolon isn't a problem. After all
we've been telling the difference between periods and comma's for quite a
long time now with no difficulty. So it's more a matter of just getting
used to looking for it in function signatures.
Ron
More information about the Python-ideas
mailing list