davidmalcolm/pygccjit — pull request #2 by sfeltman (2013-10-25 02:04:46+00:00)
Title: Add support for None to Function.add_conditionals on_false argument

Add explicit None check with conversion to NULL for the on_false argument.
Additionally add '=None' as a default value for on_false.

Notes:
It turns out Cython allows the Python None value through its arg type checking as valid by default (you can look at __Pyx_ArgTypeTest in the generated code):
https://github.com/cython/cython/wiki/FAQ#why-does-a-function-with-cdefd-parameters-accept-none

So Cython is basically does the following for the on_false argument to add_conditional (and actually any arg with None passed in explicitly):
((__pyx_obj_6gccjit_Label *)PyNone)->_c_label

It might make sense to use "#cython: nonecheck=True" as noted in the FAQ, but I'm not sure how this will affect the cases which you want None to translate into NULL (like in this pull request).