diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-07-17 19:44:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-17 19:44:10 (GMT) |
commit | 0fd27375cabd12e68a2f12cfeca11a2d5043429e (patch) | |
tree | acb748d0bc66167f6f0d6d30123a205fc5af3e9b /Include/internal/pycore_unionobject.h | |
parent | f88e138a1aa3b9a9e013963e4fd7d5cce6a0b85c (diff) | |
download | cpython-0fd27375cabd12e68a2f12cfeca11a2d5043429e.zip cpython-0fd27375cabd12e68a2f12cfeca11a2d5043429e.tar.gz cpython-0fd27375cabd12e68a2f12cfeca11a2d5043429e.tar.bz2 |
bpo-44654: Refactor and clean up the union type implementation (GH-27196)
Diffstat (limited to 'Include/internal/pycore_unionobject.h')
-rw-r--r-- | Include/internal/pycore_unionobject.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Include/internal/pycore_unionobject.h b/Include/internal/pycore_unionobject.h index 4d82b6f..236989f 100644 --- a/Include/internal/pycore_unionobject.h +++ b/Include/internal/pycore_unionobject.h @@ -8,9 +8,13 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -PyAPI_FUNC(PyObject *) _Py_Union(PyObject *args); -PyAPI_DATA(PyTypeObject) _Py_UnionType; -PyAPI_FUNC(PyObject *) _Py_union_type_or(PyObject* self, PyObject* param); +PyAPI_DATA(PyTypeObject) _PyUnion_Type; +#define _PyUnion_Check(op) Py_IS_TYPE(op, &_PyUnion_Type) +PyAPI_FUNC(PyObject *) _Py_union_type_or(PyObject *, PyObject *); + +#define _PyGenericAlias_Check(op) PyObject_TypeCheck(op, &Py_GenericAliasType) +PyAPI_FUNC(PyObject *) _Py_subs_parameters(PyObject *, PyObject *, PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) _Py_make_parameters(PyObject *); #ifdef __cplusplus } |