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 @@ -523,6 +523,10 @@ def test_ellipsis_in_generic(self):
523
523
# Shouldn't crash; see https://github.com/python/typing/issues/259
524
524
typing .List [Callable [..., str ]]
525
525
526
+ def test_or_and_ror (self ):
527
+ Callable = self .Callable
528
+ self .assertEqual (Callable | Tuple , Union [Callable , Tuple ])
529
+ self .assertEqual (Tuple | Callable , Union [Tuple , Callable ])
526
530
527
531
def test_basic (self ):
528
532
Callable = self .Callable
@@ -3906,6 +3910,10 @@ class B: ...
3906
3910
A .register (B )
3907
3911
self .assertIsSubclass (B , typing .Mapping )
3908
3912
3913
+ def test_or_and_ror (self ):
3914
+ self .assertEqual (typing .Sized | typing .Awaitable , Union [typing .Sized , typing .Awaitable ])
3915
+ self .assertEqual (typing .Coroutine | typing .Hashable , Union [typing .Coroutine , typing .Hashable ])
3916
+
3909
3917
3910
3918
class OtherABCTests (BaseTestCase ):
3911
3919
You can’t perform that action at this time.
0 commit comments