summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-02-03 22:51:43 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-02-03 22:51:43 (GMT)
commitcab3d98ca19659698a29108aabb040f2741d1a2a (patch)
tree5f44e6c9c4b24b5112690c81e8cef8707a334406 /Include
parente6a8074892810f551d9b1c1f16ebde9ebe9cc09d (diff)
downloadcpython-cab3d98ca19659698a29108aabb040f2741d1a2a.zip
cpython-cab3d98ca19659698a29108aabb040f2741d1a2a.tar.gz
cpython-cab3d98ca19659698a29108aabb040f2741d1a2a.tar.bz2
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')
-rw-r--r--Include/setobject.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/Include/setobject.h b/Include/setobject.h
index fc32367..102796d 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 *);