Good programming style

Grant Edwards grante at visi.com
Mon Sep 15 00:07:08 EDT 2008


On 2008-09-15, Adelle Hartley <adelle at akemi.com.au> wrote:
> Grant Edwards wrote:
>
>> When packages as significant as wxPython use naming
>> conventions other than PEP 8, I find it hard to make a case
>> that the PEP 8 naming convention is any better than any other.
>
> This relates to a question I was thinking about...
>
> I'm looking at porting a library that was written for COM and
> .Net to work as a Python module, and was wondering whether it
> would be better to stick to the library's current naming
> convention so that the API is as similar as possible on each
> platform, or to adopt a "when in Rome..." policy and follow
> the "most mainstream" naming pattern for each 
> platform/language.

If all that is would change is naming, then my advice would be
to keep the existing naming.  That way it matches existing
documentation and examples.  But, it does violate PEP 8.

If the API itself is going to be changed significantly so that
it's unique to the Python port (different to the point where
existing documentation and examples are no longer useful), then
using standard PEP 8 naming conventions is probably a good choice.

-- 
Grant





More information about the Python-list mailing list