bpo-44654: Refactor and clean up the union type implementation (GH-27196)

This commit is contained in:
Serhiy Storchaka 2021-07-17 22:44:10 +03:00 committed by GitHub
parent f88e138a1a
commit 0fd27375ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 88 additions and 125 deletions

View file

@ -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
}