|
||
|
|
|
|
|
PyObjC - (Developers) Coding style for PyObjCIntroductionThis document describes the coding style for PyObjC. Please use this style for new code and try apply this style to existing code while working on it. The management summary: 4-space indents in Python code, 1-TAB indents in C code. Python codeThe coding style for core Python is used (see PEP 8). For consistency with Cocoa we use mixed-case identifiers (like lookUpClass). PyObjC extensions to Apple frameworks should be clearly marked as such, preferably by prefixing names with PyObjC or pyobjc. This should make it clear to users where they should look for documentation of an item: The Apple documentation or ours. C codeThe coding style for core Python is used (see PEP 7). We use PyObjC instead of Py as the prefix for globally visible symbols. All (Objective-)C files in Modules/objc/ should include "pyobjc.h" as their first include. The (Objective-)C files in the wrappers for frameworks should include "pyobjc-api.h" and should not use other include-files in Modules/objc other than pyobjc-api.h and wrapper-const-table.h. DocumentationAll items exported by the objc module and all PyObjC extensions to Apple frameworks (the AppKit and Foundation modules) should be documented using docstrings. All documentation-- both standalone documents and docstrings-- should be marked up using reStructuredText [ReST]. ReST in DocStringsreStructuredText can be used in doc strings. ReST in DocStrings works exactly like a standalone ReST document, but the ReST is broken up slightly differently. To format the DocStrings to be ReST compatible, make the following changes/additions to the source. These examples were taken from source found in the DocUtils source tree.
|
|||||||||||||||||||||||||||
| Copyright © 2003 - 2008 The PyObjC Project |
|
|||||||||||||||||||||||||||