[Python-ideas] Explicit self argument, implicit super argument

Luke Stebbing luke.stebbing at gmail.com
Tue Nov 20 02:50:08 CET 2007


On 11/19/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Neil Toronto wrote:
>
> > class A(object):
> >      def method(self, x, y):
> >          self.x = x
> >          super.method(y)
>
> Is that really how it's going to be? What if self isn't
> called 'self'?
>
> I would rather see
>
>            super.method(self, y)

PEP 3135 specifies that the first argument of the method is used,
regardless of name:
http://www.python.org/dev/peps/pep-3135/#specification

Luke



More information about the Python-ideas mailing list