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):
523523 # Shouldn't crash; see https://github.com/python/typing/issues/259
524524 typing .List [Callable [..., str ]]
525525
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 ])
526530
527531 def test_basic (self ):
528532 Callable = self .Callable
@@ -3906,6 +3910,10 @@ class B: ...
39063910 A .register (B )
39073911 self .assertIsSubclass (B , typing .Mapping )
39083912
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+
39093917
39103918class OtherABCTests (BaseTestCase ):
39113919
You can’t perform that action at this time.
0 commit comments