[Tutor] Python Best Practice/Style Guide question

Marc Tompkins marc.tompkins at gmail.com
Tue Apr 29 19:19:48 CEST 2008


On Tue, Apr 29, 2008 at 9:22 AM, Scott SA <pydev at rscorp.ab.ca> wrote:

>    - More than one space around an assignment (or other) operator to
>      align it with another.
>

When I first started in Python, I was lining up all of my variable
assignments in blocks; I, too, find it more readable.  But then I read
Guido's notes on preferred Python style (no, I don't have a link offhand),
in which he deprecates lining things up... and suddenly I felt ashamed and
started removing my extra spaces.  When the guy who invented the language
tells me I'm doing it wrong, who am I to argue?  And after a while, I
started to internalize the rule, so now every time I see code that's lined
up with extra spaces it bugs me.

He doesn't really give a rationale, and I haven't seen one elsewhere.  I
think the real answer to your question is "Guido doesn't like it, that's
why."

Actually, looking at your original message, there's one very good
rationale:  in my email client, the text of your message is in a
proportional font, so your assignments don't line up anyway.  All those
extra spaces, and it still just looks ragged.  Padding only works in
monospace - of course, we all use monospace fonts in our respective editors,
but the rest of the world uses proportional.

-- 
www.fsrtechnologies.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080429/9a371d03/attachment.htm>


More information about the Tutor mailing list