summaryrefslogtreecommitdiffstats
path: root/Lib/copyreg.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/copyreg.py')
-rw-r--r--Lib/copyreg.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/copyreg.py b/Lib/copyreg.py
index 7ab8c12..356db6f 100644
--- a/Lib/copyreg.py
+++ b/Lib/copyreg.py
@@ -36,6 +36,12 @@ else:
pickle(complex, pickle_complex, complex)
+def pickle_union(obj):
+ import functools, operator
+ return functools.reduce, (operator.or_, obj.__args__)
+
+pickle(type(int | str), pickle_union)
+
# Support for pickling new-style objects
def _reconstructor(cls, base, state):