summaryrefslogtreecommitdiffstats
path: root/Include/object.h
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-02-02 18:17:30 (GMT)
committerFred Drake <fdrake@acm.org>2001-02-02 18:17:30 (GMT)
commit033f31270cb424efdb72abb03d925235f18d034d (patch)
treee5947972e470b7174e668a9e32f35e4c9429503b /Include/object.h
parent26d1f1443300526afe3b63fe9c5c7ef4f6a5e33d (diff)
downloadcpython-033f31270cb424efdb72abb03d925235f18d034d.zip
cpython-033f31270cb424efdb72abb03d925235f18d034d.tar.gz
cpython-033f31270cb424efdb72abb03d925235f18d034d.tar.bz2
Use a type flag to determine the applicability of the tp_weaklistoffset
field. This should avoid binary incompatibility problems with older modules that have not been recompiled.
Diffstat (limited to 'Include/object.h')
-rw-r--r--Include/object.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Include/object.h b/Include/object.h
index 972e05b..2f683eb 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -344,11 +344,18 @@ given type object has a specified feature.
#define Py_TPFLAGS_HAVE_RICHCOMPARE (1L<<5)
+/* Objects which are weakly referencable if their tp_weaklistoffset is >0 */
+/* XXX Should this have the same value as Py_TPFLAGS_HAVE_RICHCOMPARE?
+ * These both indicate a feature that appeared in the same alpha release.
+ */
+#define Py_TPFLAGS_HAVE_WEAKREFS (1L<<6)
+
#define Py_TPFLAGS_DEFAULT ( \
Py_TPFLAGS_HAVE_GETCHARBUFFER | \
Py_TPFLAGS_HAVE_SEQUENCE_IN | \
Py_TPFLAGS_HAVE_INPLACEOPS | \
Py_TPFLAGS_HAVE_RICHCOMPARE | \
+ Py_TPFLAGS_HAVE_WEAKREFS | \
0)
#define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0)