views:

194

answers:

1

Do you know any style guide for Python like "Code Like a Pythonista"?
I found chapter 2.3.4 of Expert Python Programming very interesting too.

+12  A: 

I know PEP 8. http://www.python.org/dev/peps/pep-0008/

myfreeweb
@systempuntoout, PEP8 and *Code Like a Pythonista* are the best, most-useful resources I've seen to this end. They seem to provide most of what someone would want in terms of style-recommending resources.
Mike Graham
@myfreeweb It's cited in "code like Pythonista" :)
systempuntoout
@Mike Thanks for your advice.
systempuntoout
Use some common sense when reading PEP8; for example, certainly don't wrap to 79 columns as if 80x25 is a serious development environment. 120 columns is a much more realistic number; 79 makes code needlessly ugly and hard to read. (It's hard to believe that someone actually wrote the example in that section without taking a step back and noticing how needlessly unreadable it was.)
Glenn Maynard
@Glenn I use 80 columns all the time, since I'm sometimes developing on my Netbook is quite handy to see all the file AND your navigation sidebar. Also I find that 80 columns are easier to read in many cases since your eyes have to move less horizontally, but I guess that's just me/taste or something.But in the end it always comes down to the fact that the WHOLE team should use the same style, in the end consistency matters more than personal opinions.
Ivo Wetzel
Of course, some recommendations of PEP 8 is very optional.
myfreeweb