bpo-43277: Add PySet_CheckExact to the C-API (GH-24598)

For some mysterious reason we have PySet_Check, PyFrozenSet_Check, PyAnySet_Check, PyAnySet_CheckExact and PyFrozenSet_CheckExact but no PySet_CheckExact.
This commit is contained in:
Pablo Galindo 2021-02-20 18:03:08 +00:00 • committed by GitHub
parent 46496f9d12
commit d439fb304c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 5 deletions

View file

@ -522,7 +522,7 @@ set_repr(PySetObject *so)
goto done;
listrepr = tmp;
if (!Py_IS_TYPE(so, &PySet_Type))
if (!PySet_CheckExact(so))
result = PyUnicode_FromFormat("%s({%U})",
Py_TYPE(so)->tp_name,
listrepr);