mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
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.
This commit is contained in:
parent
e6a8074892
commit
cab3d98ca1
4 changed files with 24 additions and 2 deletions
|
@ -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 *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue