Naming convention Python objects in Zope
I've resisted establishing naming conventions, but enough people have asked that conventions be established (and that I follow them ;) that I've decided to write down some. So, here they are:
- Use leading underscores as described in the Python Style Guide
- Public global variables names are spelled with CapitalizedWords,
Interface names always start with a capital
I, followed by a capital letter, as in
An exception is made for global non-factory functions, which are typically spelled with mixedCase.
- Public attribute names are mixedCase, as in "getService" or
- Local variables, including argument names
LowercaseWithUnderscores, as in
- Single-letter variable names should be avoided unless:
- Their meaning is extremely obvious from the context, and
- Brevity is desirable
The most obvious case for single-letter variables is for iteration variables.
Be tolerant of code that doesn't follow these conventions. We want to reuse lots of software written for other projects, which may not follow these conventions.
A reasonable goal is that code covered by the ZPL should follow these conventions.