[Python-Dev] the explicit self
fijall at gmail.com
Wed Aug 27 10:07:28 CEST 2008
You can provide selfless class as a class with special metaclass that
overloads __new__ and changes signature of each method. Not sure how
good is this, but requires no changes to the language and will work as
On Wed, Aug 27, 2008 at 8:46 AM, Kilian Klimek
<kilian.klimek at googlemail.com> wrote:
> i know this has been discusses very much, i'm sorry,
> but i can't help it. In a nutshell, the proposal is as
> 1. Self remains explicit (like it is now).
> 2. if a class is a subclass of a special class, e.g.
> named 'selfless', the self parameter is not required
> and a special variable, named 'this' is provided.
> For example:
> class Foo (selfless):
> def __init__ (x, y):
> this.x = x
> A patch for 3.0b3 implementing this can be found at
> Kilian Klimek
> Python-Dev mailing list
> Python-Dev at python.org
More information about the Python-Dev