diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index 9e67067a70..5e35a262dd 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -601,8 +601,6 @@ class TypesTests(unittest.TestCase): self.assertIsInstance(object().__lt__, types.MethodWrapperType) self.assertIsInstance((42).__lt__, types.MethodWrapperType) - # TODO: RUSTPYTHON - @unittest.expectedFailure def test_method_descriptor_types(self): self.assertIsInstance(str.join, types.MethodDescriptorType) self.assertIsInstance(list.append, types.MethodDescriptorType) diff --git a/vm/src/obj/objint.rs b/vm/src/obj/objint.rs index 09e4c98147..d84f060333 100644 --- a/vm/src/obj/objint.rs +++ b/vm/src/obj/objint.rs @@ -531,9 +531,13 @@ impl PyInt { zelf } - #[pymethod] + #[pyclassmethod] #[allow(clippy::match_bool)] - fn from_bytes(args: IntFromByteArgs, vm: &VirtualMachine) -> PyResult { + fn from_bytes( + cls: PyClassRef, + args: IntFromByteArgs, + vm: &VirtualMachine, + ) -> PyResult> { let signed = if let OptionalArg::Present(signed) = args.signed { signed.to_bool() } else { @@ -555,7 +559,7 @@ impl PyInt { ) } }; - Ok(x) + PyInt::new(x).into_ref_with_type(vm, cls) } #[pymethod]