Adherence to PEP 8 for published code (was: ANN: pry unit testing framework)

Ben Finney bignose+hates-spam at benfinney.id.au
Mon Apr 7 01:53:30 EDT 2008


Aldo Cortesi <aldo at nullcube.com> writes:

> Thus spake Ben Finney (bignose+hates-spam at benfinney.id.au):
> 
> > > I'm afraid that Pry is unashamedly incompatible with any other unit
> > > testing method in existence, including but not limited to doctest,
> > > unittest, nose and py.test. ;)

I didn't write this. Please preserve attribution lines correctly so we
can keep track of who wrote what.

> > Which makes the deliberate deviations from PEP 8 naming a large
> > black mark against it.
> 
> You're misunderstanding the intent of PEP 8, which was never
> supposed to dogmatically enforce a naming standard on all Python
> projects everywhere.

You're placing words in my mouth, and erecting a straw man, as I never
made that assertion.

PEP 8 only has the force that people grant it. Nevertheless, it's a
style guide that's widely accepted in the Python community, and
adhering to it in one's code makes it easier to read for the majority,
because it reduces the needless inconsistencies between different
bodies of code.

Conversely, deliberately diverging from the widely-accepted style
guide increases the cognitive load on the reader; if that divergence
is not done for a very good reason, one is imposing needless burden on
every reader of the code.

> You're also vastly overstating the impact of a minor naming
> convention choice. Calling this a "large black mark" smacks of
> scare-mongering to me.

When distributing code with the expectation that others use it, it's a
large black mark if it deliberately shun the widely-accepted,
easily-followed coding standards, for the above reasons.

I don't see why that would be scary. If you find it so, you have my
sympathy.

-- 
 \       "I went to a general store. They wouldn't let me buy anything |
  `\                                  specifically."  -- Steven Wright |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list