diff options
author | Victor Stinner <vstinner@python.org> | 2022-03-31 07:59:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 07:59:27 (GMT) |
commit | c14d7e4b816134b8e93ece4066a86d229631ce96 (patch) | |
tree | 6b2ac5b9c3e502d77d1ff05bdcc88e918dba1ad4 /Include/unicodeobject.h | |
parent | db4dada5108dd49ebca23e4559a53630a2df8447 (diff) | |
download | cpython-c14d7e4b816134b8e93ece4066a86d229631ce96.zip cpython-c14d7e4b816134b8e93ece4066a86d229631ce96.tar.gz cpython-c14d7e4b816134b8e93ece4066a86d229631ce96.tar.bz2 |
bpo-47164: Add _PyASCIIObject_CAST() macro (GH-32191)
Add macros to cast objects to PyASCIIObject*, PyCompactUnicodeObject*
and PyUnicodeObject*: _PyASCIIObject_CAST(),
_PyCompactUnicodeObject_CAST() and _PyUnicodeObject_CAST(). Using
these new macros make the code more readable and check their argument
with: assert(PyUnicode_Check(op)).
Remove redundant assert(PyUnicode_Check(op)) in macros using directly
or indirectly these new CAST macros.
Replacing existing casts with these macros.
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r-- | Include/unicodeobject.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 6426c5d..1d2f546 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -112,7 +112,7 @@ PyAPI_DATA(PyTypeObject) PyUnicode_Type; PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type; #define PyUnicode_Check(op) \ - PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS) + PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS) #define PyUnicode_CheckExact(op) Py_IS_TYPE(op, &PyUnicode_Type) /* --- Constants ---------------------------------------------------------- */ |