Can anyone suggest any other materials or resources in the same vein as this?
See http://www.quora.com/How-can-I-learn-to-program-in-Python/an...
Code Like a Pythonista: Idiomatic Python
31–40 of 59 posts
Re: Code Like a Pythonista: Idiomatic Python
#32Earlier quoted context omitted.
See http://www.quora.com/How-can-I-learn-to-program-in-Python/an...
Thanks for the reply -- I should have been more specific. I'm after something that similarly contrasts naive and idiomatic styles.
Re: Code Like a Pythonista: Idiomatic Python
#33Re: Code Like a Pythonista: Idiomatic Python
#34Earlier quoted context omitted.
You mean Python specifically or for other programming languages?
Python, specifically.
* Idioms and Anti-Idioms in Python (http://docs.python.org/howto/doanddont.html)
* Python Idioms and Efficiency (http://jaynes.colorado.edu/PythonIdioms.html)
* Python Style Guide (http://www.python.org/dev/peps/pep-0008/)
* Google Python Style Guide (http://google-styleguide.googlecode.com/svn/trunk/pyguide.html)
* Pocoo Style Guide (http://www.pocoo.org/internal/styleguide/)Re: Code Like a Pythonista: Idiomatic Python
#35Re: Code Like a Pythonista: Idiomatic Python
#36One thing that has always bugged me about PEP8 is the advice about trying to keep line length to I basically just completely ignore this part of the guidance, even though I know that in theory it makes it hard to edit code via a terminal. But this is not something we ever do in practice where I work - code on servers gets there only by being checked out of SVN. I personally find it incredibly irritating when I see pe…
Re: Code Like a Pythonista: Idiomatic Python
#37He had me up until the part where he wrote an algorithm to specifically leave out the Oxford Comma. :) Kidding aside, this was a great read.
def commalist(f, endword="and"):
"Concatenate a list of strings in the form of 'Red, Yellow, Green and Blue'."
if len(f) == 0:
return ""
elif len(f) == 1:
return f[0]
else:
return ", ".join(f[:-1]) + " " + endword + " " + f[-1]Re: Code Like a Pythonista: Idiomatic Python
#38One thing that has always bugged me about PEP8 is the advice about trying to keep line length to I basically just completely ignore this part of the guidance, even though I know that in theory it makes it hard to edit code via a terminal. But this is not something we ever do in practice where I work - code on servers gets there only by being checked out of SVN. I personally find it incredibly irritating when I see pe…
Re: Code Like a Pythonista: Idiomatic Python
#39Re: Code Like a Pythonista: Idiomatic Python
#40One thing that has always bugged me about PEP8 is the advice about trying to keep line length to I basically just completely ignore this part of the guidance, even though I know that in theory it makes it hard to edit code via a terminal. But this is not something we ever do in practice where I work - code on servers gets there only by being checked out of SVN. I personally find it incredibly irritating when I see pe…
I believe a 100 or 120 character limit is a nice compromise.