diff Include/floatobject.h @ 19550:19d271f297dc legacy-trunk

Make the PyXXX_Check() macros for the numeric types inheritance-aware.
author Guido van Rossum <guido@python.org>
date Wed, 29 Aug 2001 15:45:32 +0000
parents fe4c1034b480
children 10f5927dbf05
line wrap: on
line diff
--- a/Include/floatobject.h	Wed Aug 29 15:24:53 2001 +0000
+++ b/Include/floatobject.h	Wed Aug 29 15:45:32 2001 +0000
@@ -18,7 +18,7 @@
 
 extern DL_IMPORT(PyTypeObject) PyFloat_Type;
 
-#define PyFloat_Check(op) ((op)->ob_type == &PyFloat_Type)
+#define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
 
 /* Return Python float from string PyObject.  Second argument ignored on
    input, and, if non-NULL, NULL is stored into *junk (this tried to serve a