[Python-ideas] Positional only arguments

George Sakkis george.sakkis at gmail.com
Sun May 20 18:31:40 CEST 2007


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, ...):


George

-- 
"If I have been able to see further, it was only because I stood on
the shoulders of million monkeys."



More information about the Python-ideas mailing list