Good programming style

Ben Finney bignose+hates-spam at
Mon Sep 15 06:04:35 CEST 2008

Adelle Hartley <adelle at> writes:

> 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.

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.

The Python library you're implementing isn't being used in those other
languages, so the conventions of other languages have little
relevance. It's being used in Python code, so it should mesh well with
PEP 8 compliant code — by having the API itself comply with PEP 8.

 \              “When cryptography is outlawed, bayl bhgynjf jvyy unir |
  `\                                              cevinpl.” —Anonymous |
_o__)                                                                  |
Ben Finney

More information about the Python-list mailing list