File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -515,6 +515,10 @@ def test_ellipsis_in_generic(self):
515
515
# Shouldn't crash; see https://github.com/python/typing/issues/259
516
516
typing .List [Callable [..., str ]]
517
517
518
+ def test_or_and_ror (self ):
519
+ Callable = self .Callable
520
+ self .assertEqual (Callable | Tuple , Union [Callable , Tuple ])
521
+ self .assertEqual (Tuple | Callable , Union [Tuple , Callable ])
518
522
519
523
def test_basic (self ):
520
524
Callable = self .Callable
@@ -3834,6 +3838,10 @@ class B: ...
3834
3838
A .register (B )
3835
3839
self .assertIsSubclass (B , typing .Mapping )
3836
3840
3841
+ def test_or_and_ror (self ):
3842
+ self .assertEqual (typing .Sized | typing .Awaitable , Union [typing .Sized , typing .Awaitable ])
3843
+ self .assertEqual (typing .Coroutine | typing .Hashable , Union [typing .Coroutine , typing .Hashable ])
3844
+
3837
3845
3838
3846
class OtherABCTests (BaseTestCase ):
3839
3847
You can’t perform that action at this time.
0 commit comments