File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -3457,17 +3457,14 @@ def test_class_or_union_not_specialform(self):
34573457 w = 0
34583458 self .assertIsNone (w )
34593459
3460- def test_legacy_union_type (self ):
3460+ def test_typing_union (self ):
34613461 from typing import Union
3462- IntOrStr = Union [int , str ]
3463- name = type (IntOrStr ).__name__
3464- msg = rf"called match pattern must be a class or typing.Union of classes \(got { name } \)"
3465- w = None
3466- with self .assertRaisesRegex (TypeError , msg ):
3467- match 1 :
3468- case IntOrStr ():
3469- w = 0
3470- self .assertIsNone (w )
3462+ IntOrStr = Union [int , str ] # identical to int | str since gh-105499
3463+ w = False
3464+ match 1 :
3465+ case IntOrStr ():
3466+ w = True
3467+ self .assertIs (w , True )
34713468
34723469 def test_expanded_union_mirrors_isinstance_success (self ):
34733470 ListOfInt = list [int ]
You can’t perform that action at this time.
0 commit comments