[Python-checkins] CVS: python/dist/src/Include complexobject.h,2.7,2.8 floatobject.h,2.18,2.19 intobject.h,2.22,2.23 longobject.h,2.21,2.22

Guido van Rossum gvanrossum@users.sourceforge.net
Wed, 29 Aug 2001 08:45:34 -0700


Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv31299/Include

Modified Files:
	complexobject.h floatobject.h intobject.h longobject.h 
Log Message:
Make the PyXXX_Check() macros for the numeric types inheritance-aware.


Index: complexobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/complexobject.h,v
retrieving revision 2.7
retrieving revision 2.8
diff -C2 -d -r2.7 -r2.8
*** complexobject.h	2000/07/09 00:20:36	2.7
--- complexobject.h	2001/08/29 15:45:32	2.8
***************
*** 43,47 ****
  extern DL_IMPORT(PyTypeObject) PyComplex_Type;
  
! #define PyComplex_Check(op) ((op)->ob_type == &PyComplex_Type)
  
  extern DL_IMPORT(PyObject *) PyComplex_FromCComplex(Py_complex);
--- 43,47 ----
  extern DL_IMPORT(PyTypeObject) PyComplex_Type;
  
! #define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)
  
  extern DL_IMPORT(PyObject *) PyComplex_FromCComplex(Py_complex);

Index: floatobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/floatobject.h,v
retrieving revision 2.18
retrieving revision 2.19
diff -C2 -d -r2.18 -r2.19
*** floatobject.h	2001/05/08 15:19:57	2.18
--- floatobject.h	2001/08/29 15:45:32	2.19
***************
*** 19,23 ****
  extern DL_IMPORT(PyTypeObject) PyFloat_Type;
  
! #define PyFloat_Check(op) ((op)->ob_type == &PyFloat_Type)
  
  /* Return Python float from string PyObject.  Second argument ignored on
--- 19,23 ----
  extern DL_IMPORT(PyTypeObject) PyFloat_Type;
  
! #define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
  
  /* Return Python float from string PyObject.  Second argument ignored on

Index: intobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/intobject.h,v
retrieving revision 2.22
retrieving revision 2.23
diff -C2 -d -r2.22 -r2.23
*** intobject.h	2001/08/17 18:39:24	2.22
--- intobject.h	2001/08/29 15:45:32	2.23
***************
*** 28,32 ****
  extern DL_IMPORT(PyTypeObject) PyInt_Type;
  
! #define PyInt_Check(op) ((op)->ob_type == &PyInt_Type)
  
  extern DL_IMPORT(PyObject *) PyInt_FromString(char*, char**, int);
--- 28,32 ----
  extern DL_IMPORT(PyTypeObject) PyInt_Type;
  
! #define PyInt_Check(op) PyObject_TypeCheck(op, &PyInt_Type)
  
  extern DL_IMPORT(PyObject *) PyInt_FromString(char*, char**, int);

Index: longobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/longobject.h,v
retrieving revision 2.21
retrieving revision 2.22
diff -C2 -d -r2.21 -r2.22
*** longobject.h	2001/08/17 18:39:24	2.21
--- longobject.h	2001/08/29 15:45:32	2.22
***************
*** 12,16 ****
  extern DL_IMPORT(PyTypeObject) PyLong_Type;
  
! #define PyLong_Check(op) ((op)->ob_type == &PyLong_Type)
  
  extern DL_IMPORT(PyObject *) PyLong_FromLong(long);
--- 12,16 ----
  extern DL_IMPORT(PyTypeObject) PyLong_Type;
  
! #define PyLong_Check(op) PyObject_TypeCheck(op, &PyLong_Type)
  
  extern DL_IMPORT(PyObject *) PyLong_FromLong(long);