]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Since Py_TPFLAGS_HAVE_WEAKREFS is set in Py_TPFLAGS_DEFAULT, it does not
authorFred Drake <fdrake@acm.org>
Thu, 3 May 2001 16:04:13 +0000 (16:04 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 3 May 2001 16:04:13 +0000 (16:04 +0000)
need to be specified in the type structures independently.  The flag
exists only for binary compatibility.

This is a "source cleanliness" issue and introduces no behavioral changes.

Objects/classobject.c
Objects/funcobject.c

index 9f4d1555e99e806053c56f9efc52e7bfe518d4da..2babbfbd63fb02a504e3c264fdca3f71b6ad454d 100644 (file)
@@ -2103,7 +2103,7 @@ PyTypeObject PyMethod_Type = {
        (getattrofunc)instancemethod_getattro,  /* tp_getattro */
        (setattrofunc)instancemethod_setattro,  /* tp_setattro */
        0,                                      /* tp_as_buffer */
-       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC | Py_TPFLAGS_HAVE_WEAKREFS,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC,     /* tp_flags */
        0,                                      /* tp_doc */
        (traverseproc)instancemethod_traverse,  /* tp_traverse */
        0,                                      /* tp_clear */
index 78c968c2b462a35171c8ab4ff61a877fbea5f28e..09c6cb80217d4fec6fc9bb705326d1d7ef1d64c1 100644 (file)
@@ -320,25 +320,25 @@ PyTypeObject PyFunction_Type = {
        "function",
        sizeof(PyFunctionObject) + PyGC_HEAD_SIZE,
        0,
-       (destructor)func_dealloc, /*tp_dealloc*/
-       0,              /*tp_print*/
-       0, /*tp_getattr*/
-       0, /*tp_setattr*/
-       0, /*tp_compare*/
-       (reprfunc)func_repr, /*tp_repr*/
-       0,              /*tp_as_number*/
-       0,              /*tp_as_sequence*/
-       0,              /*tp_as_mapping*/
-       0,              /*tp_hash*/
-       0,              /*tp_call*/
-       0,              /*tp_str*/
-       (getattrofunc)func_getattro,         /*tp_getattro*/
-       (setattrofunc)func_setattro,         /*tp_setattro*/
-       0,              /* tp_as_buffer */
-       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC | Py_TPFLAGS_HAVE_WEAKREFS,
-       0,              /* tp_doc */
-       (traverseproc)func_traverse,    /* tp_traverse */
-       0,              /* tp_clear */
-       0,              /* tp_richcompare */
+       (destructor)func_dealloc,            /* tp_dealloc */
+       0,                                   /* tp_print */
+       0,                                   /* tp_getattr */
+       0,                                   /* tp_setattr */
+       0,                                   /* tp_compare */
+       (reprfunc)func_repr,                 /* tp_repr */
+       0,                                   /* tp_as_number */
+       0,                                   /* tp_as_sequence */
+       0,                                   /* tp_as_mapping */
+       0,                                   /* tp_hash */
+       0,                                   /* tp_call */
+       0,                                   /* tp_str */
+       (getattrofunc)func_getattro,         /* tp_getattro */
+       (setattrofunc)func_setattro,         /* tp_setattro */
+       0,                                   /* tp_as_buffer */
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC,  /* tp_flags */
+       0,                                   /* tp_doc */
+       (traverseproc)func_traverse,         /* tp_traverse */
+       0,                                   /* tp_clear */
+       0,                                   /* tp_richcompare */
        offsetof(PyFunctionObject, func_weakreflist), /* tp_weaklistoffset */
 };