Skip to content

Commit 2a1880c

Browse files
committed
Fix int.from_bytes type
1 parent c335791 commit 2a1880c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Lib/test/test_types.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,6 @@ def test_method_wrapper_types(self):
601601
self.assertIsInstance(object().__lt__, types.MethodWrapperType)
602602
self.assertIsInstance((42).__lt__, types.MethodWrapperType)
603603

604-
# TODO: RUSTPYTHON
605-
@unittest.expectedFailure
606604
def test_method_descriptor_types(self):
607605
self.assertIsInstance(str.join, types.MethodDescriptorType)
608606
self.assertIsInstance(list.append, types.MethodDescriptorType)

vm/src/obj/objint.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,13 @@ impl PyInt {
531531
zelf
532532
}
533533

534-
#[pymethod]
534+
#[pyclassmethod]
535535
#[allow(clippy::match_bool)]
536-
fn from_bytes(args: IntFromByteArgs, vm: &VirtualMachine) -> PyResult<BigInt> {
536+
fn from_bytes(
537+
_class: PyClassRef,
538+
args: IntFromByteArgs,
539+
vm: &VirtualMachine,
540+
) -> PyResult<BigInt> {
537541
let signed = if let OptionalArg::Present(signed) = args.signed {
538542
signed.to_bool()
539543
} else {

0 commit comments

Comments
 (0)