<div dir="ltr">Normally I agree with you on the single-character identifiers, but I consider this case an exception. Lets not forget that C++ and Java use zero-character identifiers
for "self", and I don't hear a din of complaints that it harms
readability.<br><br>
My code does not appear to me to be any less readable to me when I substitute "S" for "self". The fact that it is a capital letter helps a bit here, I think. The fact that it usually appears as "S.attr" rather than just "S" also makes it stand out clearly. <br>
<br>I just don't see the problem with having an "approved" shorthand form for self when it does not require any changes in the language itself.<br><br>--Russ<br><br><br><div class="gmail_quote">On Wed, Aug 27, 2008 at 12:11 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 class="Ih2E3d">On 27 aug 2008 at 02:02:39, Russ Paielli <<a href="mailto:russ.paielli@gmail.com">russ.paielli@gmail.com</a>> wrote:<br>

<br>
> My editor, Xemacs, also highlights the word "self." I personally find that a<br>
> bit annoying, and perhaps that is part of the reason I don't appreciate the<br>
> word. When I write an algorithm, I don't want to see some artifact<br>
> highlighted, as if it is somehow the most important part of the algorithm. I<br>
> like seeing keywords highlighted, but I don't want to see "self" highlighted<br>
> because it is only a convention. Maybe I'm alone on that.<br>
><br>
> As I wrote earlier, I copied one of my larger Python files and replaced each<br>
> occurrence of "self" with "S". That was approximately 350 occurrences. I<br>
> also replaced each occurrence of "cls" with "C", which was another 50 or so<br>
> occurrences. The file size was reduced by 2.8%, many wrapped lines no longer<br>
> need to wrap, and I like the way it looks.<br>
><br>
> I understand that people like to have "one true way," but I think Python<br>
> programmers are adaptable enough to handle this one. When you read code, you<br>
> certainly need to read the argument names anyway, so the fact that "S" is<br>
> being used instead of "self" should be obvious. The only minor disadvantage<br>
> I can think of is that searching on a single character can be problematic,<br>
> but if you are using an IDE, that should not be an issue (and I can't<br>
> remember ever searching on "self" anyway).<br>
><br>
> One of these days, when I get a chance, I may write an informational PEP<br>
> recommending the use of "S" as an acceptable replacement for "self", and "C"<br>
> as an accptable replacement for "cls". I hope that doesn't blow any fuses.<br>
><br>
> Have a nice day.<br>
><br>
> --Russ<br>
<br>
</div>I absolutely disagree. It's the same thing that happens when we use one<br>
character identifiers: the code becomes less readable.<br>
<br>
Identifiers must be self-explicative.<br>
<br>
Cheers,<br>
<font color="#888888">Cesare<br>
</font></blockquote></div><br><br clear="all"><br>-- <br><a href="http://RussP.us">http://RussP.us</a><br>
</div>