New PEP: Quality Guidelines For Standard Modules

Paul Prescod paulp at ActiveState.com
Mon Jul 2 23:12:28 EDT 2001


We all know that there will be legitimate reasons for violating these
guidelines. It occurs to me that the way to minimize violations without
being totally heavy handed is to require violations to be documented and
justified (inline, or in the module documentation, or in some kind of
PEP, or whatever.)

So for FileInput there would be a paragraph somewhere that says: "The
fileinput module violates the restriction on global variables in order
to simplify the common case of doing X Y Z. If you want to use it in a
threaded (or otherwise sophisticated) context, you can use the FileInput
class instead of the global functions."

Documenting the deviation from the spec allows us all to read and
determine whether the deviation is justified and, more important,
demonstrates that the author understood the spec and took it into
account. Like a PEP, it also (in theory) will reduce the likelihood of
repeated arguments because the arguments will be captured in a document.
-- 
Take a recipe. Leave a recipe.  
Python Cookbook!  http://www.ActiveState.com/pythoncookbook




More information about the Python-list mailing list