Python C API: Constructing bool (True, False) values

Lexy Zhitenev zhitenev at
Wed Mar 19 09:26:28 CET 2003

> Py_True and Py_False are global constants, like Py_None.  So, e.g.,
>     Py_INCREF(Py_True);
>     return Py_True;
> to return True (in Python 2.3; before 2.3, Py_True resolves to the int 1).
Thank you

More information about the Python-list mailing list