[Python-3000] Removing 'self' from method definitions

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Apr 18 02:01:00 CEST 2006


Michael P. Soulier wrote:

> Although you do have to put the current class name in the method calls, as
> super() requires it as the first argument. I never understood that. Why would
> I wish to use super(Bar) if I'm in class Foo? Cannot Foo be implied here?

The problem is that there's no way for Python to know
which class the method is "in", in the sense required
here.

That could be fixed by giving functions defined inside
a class statement an attribute referring back to the
class. It would create a circular reference, but that's
not so much of a problem these days.

--
Greg


More information about the Python-3000 mailing list