File tree Expand file tree Collapse file tree 2 files changed +1
-5
lines changed Expand file tree Collapse file tree 2 files changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -868,8 +868,6 @@ def forward_before(x: ForwardBefore[int]) -> None: ...
868
868
assert typing .get_args (typing .get_type_hints (forward_after )['x' ]) == (int , Forward )
869
869
assert typing .get_args (typing .get_type_hints (forward_before )['x' ]) == (int , Forward )
870
870
871
- # TODO: RUSTPYTHON
872
- @unittest .expectedFailure
873
871
def test_or_type_operator_with_Protocol (self ):
874
872
class Proto (typing .Protocol ):
875
873
def meth (self ) -> int :
@@ -884,8 +882,6 @@ def test_or_type_operator_with_NamedTuple(self):
884
882
NT = namedtuple ('A' , ['B' , 'C' , 'D' ])
885
883
assert NT | str == typing .Union [NT ,str ]
886
884
887
- # TODO: RUSTPYTHON
888
- @unittest .expectedFailure
889
885
def test_or_type_operator_with_TypedDict (self ):
890
886
class Point2D (typing .TypedDict ):
891
887
x : int
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ impl PyUnion {
104
104
105
105
pub fn is_unionable ( obj : PyObjectRef , vm : & VirtualMachine ) -> bool {
106
106
obj. class ( ) . is ( vm. ctx . types . none_type )
107
- || obj. class ( ) . is ( vm . ctx . types . type_type )
107
+ || obj. payload_if_subclass :: < PyType > ( vm ) . is_some ( )
108
108
|| obj. class ( ) . is ( vm. ctx . types . generic_alias_type )
109
109
|| obj. class ( ) . is ( vm. ctx . types . union_type )
110
110
}
You can’t perform that action at this time.
0 commit comments