aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Modules/_typingmodule.c
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2025-03-04 11:44:19 -0800
committerGitHub <noreply@github.com>2025-03-04 11:44:19 -0800
commitdc6d66f44c0a25b69dfec7e4ffc4a6fa5e4feada (patch)
tree045fed4b7965d56ea45c009dad6dddb42d7be8b0 /Modules/_typingmodule.c
parente091520fdbcfe406e5fdcf66b7864b2b34a6726b (diff)
downloadcpython-dc6d66f44c0a25b69dfec7e4ffc4a6fa5e4feada.tar.gz
cpython-dc6d66f44c0a25b69dfec7e4ffc4a6fa5e4feada.zip
gh-105499: Merge typing.Union and types.UnionType (#105511)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Ken Jin <kenjin@python.org> Co-authored-by: Carl Meyer <carl@oddbird.net>
Diffstat (limited to 'Modules/_typingmodule.c')
-rw-r--r--Modules/_typingmodule.c8
1 files changed, 6 insertions, 2 deletions
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;
}