6

Are all PEP 8 rules still valid?

Are there any which are obsolete?

Isn't there a more explanatory cheat sheet that this one.

neubert
  • 15,947
  • 24
  • 120
  • 212
vidul
  • 61
  • 3
  • What? What does "still valid" mean? Please explain what you mean by "obsolete"? What are you asking? The language hasn't changed, why would suggested formatting change? What did you expect? Please explain what you want to know. It doesn't seem sensible for formatting rules to become "obsolete". Please explain what you mean. – S.Lott Oct 18 '10 at 00:54
  • The language has changed, like any normal software product.The same goes for the PEP 8 manual, that's why it is updated frequently. – vidul Oct 18 '10 at 17:38

3 Answers3

6

Here is the current version of PEP 8. It was last updated 2010 August 29.

wkl
  • 77,184
  • 16
  • 165
  • 176
2

PEP 8 is still the preferred style guide for Python code. Watching the changes to Django, for instance, I see edits for PEP 8 (such as "2 blank lines after the imports.)

They are still suggestions, though strong ones, and differences in house style are out there.

I didn't know about that cheat-sheet before; seems like having one like that is a good idea!

Adam Vandenberg
  • 19,991
  • 9
  • 54
  • 56
  • 1
    +1 for "suggestions". One of my favorite lines of the PEP says `But most importantly: know when to be inconsistent -- sometimes the style guide just doesn't apply. When in doubt, use your best judgment. Look at other examples and decide what looks best.` – snapshoe Oct 17 '10 at 19:54
1

I still go by the PEP 8 rules, as they are recommended in the Python tutorial. I assume all are still valid, but others may differ (Google for instance has different rules).

Peter C
  • 6,219
  • 1
  • 25
  • 37