[Python-ideas] Suggestion for Style Guide for Python Code PEP 8

Georg Brandl g.brandl at gmx.net
Sat May 14 16:17:11 CEST 2011


On 14.05.2011 06:50, Rahul Amaram wrote:
> Thanks for the reply George and Weeble. It would nice if these kind of 
> minor programming guidelines are also included in some page probably 
> titled "Extended Python Guidelines" :). The reason being novice 
> programmers in python who have worked in previous languages tend to use 
> the same style of coding as in other languages. So, for instance, to 
> check for the existence of a key in a dictionary, it is extremely likely 
> that they'd either look for a has_key method or get a list of all the 
> keys and search in it. Anyway, as you said, there might a lot of such 
> small idioms in python, which may not make sense to cover in PEP 8 but 
> if they are really the recommended way of doing the operation, then we 
> probably should have them documented in one place.

I'd hope that simple things like "k in d" are already in every tutorial
on Python that's worth anything...

Georg





More information about the Python-ideas mailing list