Mercurial > cpython-lru_cache-weakref
diff Include/boolobject.h @ 22787:028ebc8fb390 legacy-trunk
Oops. Here are the new files. My apologies.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 03 Apr 2002 23:01:45 +0000 |
| parents | |
| children | a6527d1ee474 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Include/boolobject.h Wed Apr 03 23:01:45 2002 +0000 @@ -0,0 +1,20 @@ +/* Boolean object interface */ + +typedef PyIntObject PyBoolObject; + +extern DL_IMPORT(PyTypeObject) PyBool_Type; + +#define PyBool_Check(x) ((x)->ob_type == &PyBool_Type) + +/* Py_False and Py_True are the only two bools in existence. +Don't forget to apply Py_INCREF() when returning either!!! */ + +/* Don't use these directly */ +extern DL_IMPORT(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct; + +/* Use these macros */ +#define Py_False ((PyObject *) &_Py_ZeroStruct) +#define Py_True ((PyObject *) &_Py_TrueStruct) + +/* Function to return a bool from a C long */ +PyObject *PyBool_FromLong(long);
