[Python-3000] PEP 8 Style Guide and Python 3

Terry Reedy tjreedy at udel.edu
Sat May 3 02:02:56 CEST 2008


At least one of the style recommendations in PEP 8 -- use class rather that 
string exceptions -- is obsolete in Py 3.  And there are others, and 
perhaps others where the spirit of the recommendation is the same but 
details are different.

For a new Python 3 programmer who does not need or want to know anything 
about Python 2, reading about 'string exceptions' would be confusing.

One possibility for isolation is for each major section to have separate 
2.x and 3.x subsections.  But where there are several scattered changes, 
this would require large chunks of duplication.  For instance, under

Prescriptive: Naming Conventions
     Package and Module Names
          Modules should have...

becomes Modules must have ... (I presume, hence the renaming project).
But all three paragraphs would have to be duplicated in 2.x and 3.x to be 
coherent, and then they would not be in their sensible place.

A couple of paragraphs on, 'because exceptions should be classes' becomes 
'because exceptions are classes'.  Again, moving two variants to 2.x and 
3.x sections would be awkward.

So, especially if PEP 8 is considered more or less frozen, I suggest the 
possibility of a new PEP 3008, Python 3 style guide.

Terry Jan Reedy





More information about the Python-3000 mailing list