Good programming style

Grant Edwards grante at visi.com
Mon Sep 15 01:13:48 EDT 2008


On 2008-09-15, Ben Finney <bignose+hates-spam at benfinney.id.au> wrote:
> Grant Edwards <grante at visi.com> writes:
>
>> On 2008-09-15, Ben Finney <bignose+hates-spam at benfinney.id.au> wrote:
>> > I think it's more important for Python library APIs to comply with
>> > the Python coding guidelines (as specified in PEP 8) than to
>> > comply with standards in other languages.
>> 
>> I think the practical matter of being able to use existing
>> documentation and examples
>
> How are examples written in another language a "practical matter" for
> using a Python library? Surely less "practical" than having one's
> Python code base use a consistent style.

If there is already a set of documentation and usage examples
for the library, then changing the names just for the sake of
"purity" means that you've now got documentation that's wrong.

For example, the vast majority of wxPython consists of wrapped
C++ library routines.  There is a large body of existing
documentation and sample code for those library routines, and
they're all CamelCase.  IMO, following that documentation is
more important and useful than having all the names changed to
agree with other Python libraries.  (It's also a lot less work.)

-- 
Grant




More information about the Python-list mailing list