The whitespaceless frontend

Sion Arrowsmith siona at chiark.greenend.org.uk
Wed Apr 26 07:44:30 EDT 2006


Edward Elliott  <nobody at 127.0.0.1> wrote:
>If compactness is all you want, shorten self to s.  Personally I like 'me'
>as it's both shorter and more vernacular:
>
>def do_GET (me):
>    me.send_response (200, "ok")

Absolutely. I've written quite a lot of code (which I wasn't expecting
anyone else to maintain) using 'I' for the same reasons. Plus, it's
even shorter in terms of characters (if not keystrokes), stands out
reasonably well, and for how I read it makes for better English
grammar (eg I.send_response(...) -- I guess it depends on whether
you're doing the mental transformation of method call to message
passing).

I stopped doing this when I started (a) maintaining other people's
Python code, and having them maintain mine and (b) using editors
whose Python syntax highlighting coloured "self" as special.
"Readability counts" wins over a couple of extra characters.

-- 
\S -- siona at chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
  ___  |  "Frankly I have no feelings towards penguins one way or the other"
  \X/  |    -- Arthur C. Clarke
   her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump



More information about the Python-list mailing list