<div dir="ltr"><br><br><div class="gmail_quote">On Wed, Aug 27, 2008 at 9:14 AM, Cesare Di Mauro <span dir="ltr"><<a href="mailto:cesare.dimauro@a-tono.com">cesare.dimauro@a-tono.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On 27 agu 2008 at 08:46:15, Kilian Klimek <<a href="mailto:kilian.klimek@googlemail.com">kilian.klimek@googlemail.com</a>> wrote:<br>
<br>
> Hello,<br>
><br>
> i know this has been discusses very much, i'm sorry,<br>
> but i can't help it. In a nutshell, the proposal is as<br>
> follows:<br>
><br>
> 1. Self remains explicit (like it is now).<br>
> 2. if a class is a subclass of a special class, e.g.<br>
> named 'selfless', the self parameter is not required<br>
> and a special variable, named 'this' is provided.<br>
><br>
><br>
> For example:<br>
><br>
> class Foo (selfless):<br>
> def __init__ (x, y):<br>
> this.x = x<br>
> ...<br>
><br>
> A patch for 3.0b3 implementing this can be found at<br>
> <a href="http://www-lehre.inf.uos.de/%7Ekklimek/misc/python_slp_8.diff" target="_blank">http://www-lehre.inf.uos.de/~kklimek/misc/python_slp_8.diff</a><br>
><br>
> regards,<br>
> Kilian Klimek<br>
><br>
<br>
</div></div>I disagree. From "The Zen of Python":<br>
<br>
Explicit is better than implicit.</blockquote><div><br>no point in discussing this, but ...<br> <br></div><div>someone else emailed me this one too and i don't see the point: writing
down 'self' as the first paramenter of your method does not make it any
more explicit what it means. (If you want to consider readability: even
worse, you can name it whatever you want).<br>
<br>
Saying "your method must accept an extra parameter (which most people
call 'self') that carries all object attributes" is hardly any more
explicit then saying "there is a special variable (which is always
named 'this') that carries all object attributes".<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Readability counts.<br>
Special cases aren't special enough to break the rules.<br>
There should be one-- and preferably only one --obvious way to do it.<br>
<br>
Cheers,<br>
<font color="#888888">Cesare<br>
</font></blockquote></div><br></div>