[Python-Dev] 2.4.4: backport classobject.c HAVE_WEAKREFS?

Raymond Hettinger rhettinger at ewtllc.com
Fri Oct 6 17:48:15 CEST 2006


No need to backport.  Py_TPFLAGS_DEFAULT implies
Py_TPFLAGS_HAVE_WEAKREFS.


The change was for clarity -- most things that have the weakref slots
filled-in will also make the flag explicit -- that makes it easier on
the brain when verifying code that checks the weakref flag.


Raymond




-----Original Message-----
From: python-dev-bounces+rhettinger=ewtllc.com at python.org
[mailto:python-dev-bounces+rhettinger=ewtllc.com at python.org] On Behalf
Of A.M. Kuchling
Sent: Friday, October 06, 2006 6:41 AM
To: python-dev at python.org
Subject: [Python-Dev] 2.4.4: backport classobject.c HAVE_WEAKREFS?

I was looking at the logs for classobject.c and noticed this commit
that adds Py_TPFLAGS_HAVE_WEAKREFS to the instance type.  Should it be
backported to 2.4?  (It looks to me like it should, but I don't know
anything about weakref implementation and want to get approval from
someone who knows.)

--amk

r39038 | rhettinger | 2005-06-19 04:42:20 -0400 (Sun, 19 Jun 2005) | 2
lines

Insert missing flag.

------------------------------------------------------------------------
Index: classobject.c
===================================================================
--- classobject.c       (revision 39037)
+++ classobject.c       (revision 39038)
@@ -2486,7 +2486,7 @@
        (getattrofunc)instancemethod_getattro,  /* tp_getattro */
        PyObject_GenericSetAttr,                /* tp_setattro */
        0,                                      /* tp_as_buffer */
-       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC  |
Py_TPFLAGS_HAVE_WEAKREFS, /* tp_flags */
        instancemethod_doc,                     /* tp_doc */
        (traverseproc)instancemethod_traverse,  /* tp_traverse */
        0,                                      /* tp_clear */
svn merge -r 39037:39038 svn+ssh://pythondev@svn.python.org/python/trunk
_______________________________________________
Python-Dev mailing list
Python-Dev at python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/rhettinger%40ewtllc.co
m



More information about the Python-Dev mailing list