Examples of reliable coding of Python 'C' extensions by Paul Ross.
Introduction to reference counts in Python C extensions. Managing exceptions. A canonical function pattern for C extensions. Handling function arguments. Creating, setting and getting module globals.