_dbus_bindings: debug-impl.h -> debug.c
[dbus-python-phuang.git] / HACKING.txt
blob90679d53c176431b1ba9c083c85f65892946fd51
1 =========================================
2 D-Bus Python bindings - notes for hackers
3 =========================================
5 :Author: Simon McVittie
6 :Date: 2006-09-26
8 Code organisation
9 =================
11 Python wants everything except the init function to be declared static, so the
12 whole of _dbus_bindings is a single translation unit - module.c #includes
13 various files *-impl.h, which define static (sometimes static inline)
14 functions. Even so, it compiles quicker than the old Pyrex implementation :-p
16 Threading/locking model
17 =======================
19 All Python functions must be called with the GIL (obviously).
21 Before calling into any D-Bus function that can block, release the GIL;
22 as well as the usual "be nice to other threads", D-Bus does its own
23 locking and we don't want to deadlock with it. Most Connection methods
24 can block.
26 Indentation and other holy wars
27 ===============================
29 Python code is meant to follow PEP8, and has 4-space indentation, no hard tabs.
31 C code is meant to follow what PEP7 refers to as "Python 3000" style - 4-space
32 indentation, no hard tabs, otherwise consistent with historical Python 2.x
33 code.
35 Docstrings etc. are reStructuredText.