From dc6d66f44c0a25b69dfec7e4ffc4a6fa5e4feada Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 4 Mar 2025 11:44:19 -0800 Subject: gh-105499: Merge typing.Union and types.UnionType (#105511) Co-authored-by: Alex Waygood Co-authored-by: Ken Jin Co-authored-by: Carl Meyer --- Modules/_typingmodule.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Modules/_typingmodule.c') diff --git a/Modules/_typingmodule.c b/Modules/_typingmodule.c index 09fbb3c5e8b..e51279c808a 100644 --- a/Modules/_typingmodule.c +++ b/Modules/_typingmodule.c @@ -5,9 +5,10 @@ #endif #include "Python.h" -#include "pycore_interp.h" +#include "internal/pycore_interp.h" +#include "internal/pycore_typevarobject.h" +#include "internal/pycore_unionobject.h" // _PyUnion_Type #include "pycore_pystate.h" // _PyInterpreterState_GET() -#include "pycore_typevarobject.h" #include "clinic/_typingmodule.c.h" /*[clinic input] @@ -63,6 +64,9 @@ _typing_exec(PyObject *m) if (PyModule_AddObjectRef(m, "TypeAliasType", (PyObject *)&_PyTypeAlias_Type) < 0) { return -1; } + if (PyModule_AddObjectRef(m, "Union", (PyObject *)&_PyUnion_Type) < 0) { + return -1; + } if (PyModule_AddObjectRef(m, "NoDefault", (PyObject *)&_Py_NoDefaultStruct) < 0) { return -1; } -- cgit v1.2.3