A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-August/082037.html below:

[Python-Dev] the explicit self

[Python-Dev] the explicit selfGary Herron gherron at islandtraining.com
Wed Aug 27 09:12:50 CEST 2008
Kilian Klimek wrote:
> Hello,
>
> i know this has been discusses very much, i'm sorry,
> but i can't help it. In a nutshell, the proposal is as
> follows:
>
> 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
> http://www-lehre.inf.uos.de/~kklimek/misc/python_slp_8.diff 
> <http://www-lehre.inf.uos.de/%7Ekklimek/misc/python_slp_8.diff>

Why not just do this?


class Foo:
    def __init__ (this, x, y):
        this.x = x


It's fewer characters, it gets rid of the "self" you seem to dread, and 
it requires no patches or changes of any kind to Python.  And most 
importantly, has no need to introduce any "magic" into the language.

Gary Herron


>
> regards,
> Kilian Klimek
> ------------------------------------------------------------------------
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/gherron%40islandtraining.com
>   

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4