File tree 1 file changed +2
-9
lines changed
1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ class Format(enum.IntEnum):
27
27
STRING = 4
28
28
29
29
30
- _Union = None
31
30
_sentinel = object ()
32
31
33
32
# Slots shared by ForwardRef and _Stringifier. The __forward__ names must be
@@ -246,16 +245,10 @@ def __hash__(self):
246
245
return hash ((self .__forward_arg__ , self .__forward_module__ ))
247
246
248
247
def __or__ (self , other ):
249
- global _Union
250
- if _Union is None :
251
- from typing import Union as _Union
252
- return _Union [self , other ]
248
+ return types .UnionType [self , other ]
253
249
254
250
def __ror__ (self , other ):
255
- global _Union
256
- if _Union is None :
257
- from typing import Union as _Union
258
- return _Union [other , self ]
251
+ return types .UnionType [other , self ]
259
252
260
253
def __repr__ (self ):
261
254
if self .__forward_module__ is None :
You can’t perform that action at this time.
0 commit comments