diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index ba031c0613..6e3833738b 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -929,8 +929,6 @@ def test_or_type_operator_with_SpecialForm(self): assert typing.Optional[int] | str == typing.Union[int, str, None] assert typing.Union[int, bool] | str == typing.Union[int, bool, str] - # TODO: RUSTPYTHON - @unittest.expectedFailure def test_or_type_repr(self): assert repr(int | str) == "int | str" assert repr((int | str) | list) == "int | str | list" diff --git a/vm/src/builtins/union.rs b/vm/src/builtins/union.rs index d61198dfe9..3f8905f14a 100644 --- a/vm/src/builtins/union.rs +++ b/vm/src/builtins/union.rs @@ -43,7 +43,7 @@ impl PyUnion { #[pymethod(magic)] fn repr(&self, vm: &VirtualMachine) -> PyResult { fn repr_item(obj: PyObjectRef, vm: &VirtualMachine) -> PyResult { - if vm.is_none(&obj) { + if obj.is(vm.ctx.types.none_type) { return Ok("None".to_string()); }