Use conditional compilation to make your code able to compile under both Python 2.x and 3.0 C-API.

Now Python 3 uses Unicode as internal string representation, all the class name, method name, etc are Unicode strings. So check all the occurrences of PyString_*, most of them should be replaced with PyUnicode_*. When you suffer a segmentation fault, sometimes it's because you provided a PyString where the C-API is expecting a PyUnicode. Also, for the return value of your C extension function, you may use PyUnicode instead of PyString, otherwise you may break your client's code.

PyInt_* removed, but you can explicitly #include <intobject.h> to define aliases that redirect most PyInt_* symbols to PyLong_*.

Read PEP 3121 Extension Module Initialization and Finalization (http://www.python.org/dev/peps/pep-3121/) and change your code to the new API. It solved many problems for module initialization and finalization.

Now PyObject_Compare() raises exception when comparing two objects of different type. (In case of Python 2.x, it compares their pointer.)

If your object has slicing interface (eg. obj[2:5]), you should notice that getitem, setitem and delitem now receive PySliceObject instead of a pair of integer value.

Unbound method removed. In Python 3 you can use PyInstanceMethod_New() C-API to generate an unbound method for your C function.