diff Include/complexobject.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 5709ddba423c
children 733314fcfdaa
line wrap: on
line diff
--- a/Include/complexobject.h	Wed Aug 29 15:24:53 2001 +0000
+++ b/Include/complexobject.h	Wed Aug 29 15:45:32 2001 +0000
@@ -42,7 +42,7 @@
 
 extern DL_IMPORT(PyTypeObject) PyComplex_Type;
 
-#define PyComplex_Check(op) ((op)->ob_type == &PyComplex_Type)
+#define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)
 
 extern DL_IMPORT(PyObject *) PyComplex_FromCComplex(Py_complex);
 extern DL_IMPORT(PyObject *) PyComplex_FromDoubles(double real, double imag);