summaryrefslogtreecommitdiff
path: root/Include/setobject.h
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-02-03 22:51:43 +0000
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-02-03 22:51:43 +0000
commit84155225f7d829342c321f520ae29f9f5d0bbac3 (patch)
treee5beaed2e2f0491a316e59d1210aaaa974cc103d /Include/setobject.h
parentd0764173a7d4e1812c39cc5c6e09d72389629bc6 (diff)
downloadcpython-84155225f7d829342c321f520ae29f9f5d0bbac3.tar.gz
Ensure that PySet_Add() operates on a newly created frozenset, like PyTuple_SetItem does.
Add PyFrozenSet_Check(), which was not needed before; The list of Py*Set_Check* macros seems to be complete now. Add missing NEWS entries about all this.
Diffstat (limited to 'Include/setobject.h')
-rw-r--r--Include/setobject.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/Include/setobject.h b/Include/setobject.h
index fc32367724..102796d315 100644
--- a/Include/setobject.h
+++ b/Include/setobject.h
@@ -74,7 +74,11 @@ PyAPI_DATA(PyTypeObject) PyFrozenSet_Type;
PyType_IsSubtype(Py_TYPE(ob), &PySet_Type) || \
PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type))
#define PySet_Check(ob) \
- (Py_TYPE(ob) == &PySet_Type || PyType_IsSubtype(Py_TYPE(ob), &PySet_Type))
+ (Py_TYPE(ob) == &PySet_Type || \
+ PyType_IsSubtype(Py_TYPE(ob), &PySet_Type))
+#define PyFrozenSet_Check(ob) \
+ (Py_TYPE(ob) == &PyFrozenSet_Type || \\
+ PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type))
PyAPI_FUNC(PyObject *) PySet_New(PyObject *);
PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *);