Skip to content

Commit 9f2e346

Browse files
committed
Merged revisions 56467-56482 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/p3yk ................ r56477 | martin.v.loewis | 2007-07-21 09:04:38 +0200 (Sa, 21 Jul 2007) | 11 lines Merged revisions 56466-56476 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r56476 | martin.v.loewis | 2007-07-21 08:55:02 +0200 (Sa, 21 Jul 2007) | 4 lines PEP 3123: Provide forward compatibility with Python 3.0, while keeping backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT. ........ ................ r56478 | martin.v.loewis | 2007-07-21 09:47:23 +0200 (Sa, 21 Jul 2007) | 2 lines PEP 3123: Use proper C inheritance for PyObject. ................ r56479 | martin.v.loewis | 2007-07-21 10:06:55 +0200 (Sa, 21 Jul 2007) | 3 lines Add longintrepr.h to Python.h, so that the compiler can see that PyFalse is really some kind of PyObject*. ................ r56480 | martin.v.loewis | 2007-07-21 10:47:18 +0200 (Sa, 21 Jul 2007) | 2 lines Qualify SHIFT, MASK, BASE. ................ r56482 | martin.v.loewis | 2007-07-21 19:10:57 +0200 (Sa, 21 Jul 2007) | 2 lines Correctly refer to _ob_next. ................
1 parent b972a78 commit 9f2e346

File tree

134 files changed

+1388
-1577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+1388
-1577
lines changed

Include/Python.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@
6767
#include "bytesobject.h"
6868
#include "unicodeobject.h"
6969
#include "intobject.h"
70-
#include "boolobject.h"
7170
#include "longobject.h"
71+
#include "longintrepr.h"
72+
#include "boolobject.h"
7273
#include "floatobject.h"
7374
#ifndef WITHOUT_COMPLEX
7475
#include "complexobject.h"

Include/abstract.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
986986
*/
987987

988988
#define PySequence_ITEM(o, i)\
989-
( o->ob_type->tp_as_sequence->sq_item(o, i) )
989+
( Py_Type(o)->tp_as_sequence->sq_item(o, i) )
990990
/* Assume tp_as_sequence and sq_item exist and that i does not
991991
need to be corrected for a negative index
992992
*/

Include/boolobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extern "C" {
99

1010
PyAPI_DATA(PyTypeObject) PyBool_Type;
1111

12-
#define PyBool_Check(x) ((x)->ob_type == &PyBool_Type)
12+
#define PyBool_Check(x) (Py_Type(x) == &PyBool_Type)
1313

1414
/* Py_False and Py_True are the only two bools in existence.
1515
Don't forget to apply Py_INCREF() when returning either!!! */

Include/bufferobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern "C" {
1212

1313
PyAPI_DATA(PyTypeObject) PyBuffer_Type;
1414

15-
#define PyBuffer_Check(op) ((op)->ob_type == &PyBuffer_Type)
15+
#define PyBuffer_Check(op) (Py_Type(op) == &PyBuffer_Type)
1616

1717
#define Py_END_OF_BUFFER (-1)
1818

Include/bytesobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ PyAPI_DATA(PyTypeObject) PyBytes_Type;
3030

3131
/* Type check macros */
3232
#define PyBytes_Check(self) PyObject_TypeCheck(self, &PyBytes_Type)
33-
#define PyBytes_CheckExact(self) ((self)->ob_type == &PyBytes_Type)
33+
#define PyBytes_CheckExact(self) (Py_Type(self) == &PyBytes_Type)
3434

3535
/* Direct API functions */
3636
PyAPI_FUNC(PyObject *) PyBytes_FromObject(PyObject *);

Include/cStringIO.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ static struct PycStringIO_CAPI {
6060

6161
/* These can be used to test if you have one */
6262
#define PycStringIO_InputCheck(O) \
63-
((O)->ob_type==PycStringIO->InputType)
63+
(Py_Type(O)==PycStringIO->InputType)
6464
#define PycStringIO_OutputCheck(O) \
65-
((O)->ob_type==PycStringIO->OutputType)
65+
(Py_Type(O)==PycStringIO->OutputType)
6666

6767
#ifdef __cplusplus
6868
}

Include/cellobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ typedef struct {
1313

1414
PyAPI_DATA(PyTypeObject) PyCell_Type;
1515

16-
#define PyCell_Check(op) ((op)->ob_type == &PyCell_Type)
16+
#define PyCell_Check(op) (Py_Type(op) == &PyCell_Type)
1717

1818
PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
1919
PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);

Include/cobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ extern "C" {
1616

1717
PyAPI_DATA(PyTypeObject) PyCObject_Type;
1818

19-
#define PyCObject_Check(op) ((op)->ob_type == &PyCObject_Type)
19+
#define PyCObject_Check(op) (Py_Type(op) == &PyCObject_Type)
2020

2121
/* Create a PyCObject from a pointer to a C object and an optional
2222
destructor function. If the second argument is non-null, then it

Include/code.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ typedef struct {
5959

6060
PyAPI_DATA(PyTypeObject) PyCode_Type;
6161

62-
#define PyCode_Check(op) ((op)->ob_type == &PyCode_Type)
62+
#define PyCode_Check(op) (Py_Type(op) == &PyCode_Type)
6363
#define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars))
6464

6565
/* Public interface */
@@ -72,7 +72,7 @@ PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int);
7272

7373
/* for internal use only */
7474
#define _PyCode_GETCODEPTR(co, pp) \
75-
((*(co)->co_code->ob_type->tp_as_buffer->bf_getreadbuffer) \
75+
((*Py_Type((co)->co_code)->tp_as_buffer->bf_getreadbuffer) \
7676
((co)->co_code, 0, (void **)(pp)))
7777

7878
typedef struct _addr_pair {

Include/complexobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ typedef struct {
4343
PyAPI_DATA(PyTypeObject) PyComplex_Type;
4444

4545
#define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)
46-
#define PyComplex_CheckExact(op) ((op)->ob_type == &PyComplex_Type)
46+
#define PyComplex_CheckExact(op) (Py_Type(op) == &PyComplex_Type)
4747

4848
PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
4949
PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag);

0 commit comments

Comments
 (0)