File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -601,8 +601,6 @@ def test_method_wrapper_types(self):
601
601
self .assertIsInstance (object ().__lt__ , types .MethodWrapperType )
602
602
self .assertIsInstance ((42 ).__lt__ , types .MethodWrapperType )
603
603
604
- # TODO: RUSTPYTHON
605
- @unittest .expectedFailure
606
604
def test_method_descriptor_types (self ):
607
605
self .assertIsInstance (str .join , types .MethodDescriptorType )
608
606
self .assertIsInstance (list .append , types .MethodDescriptorType )
Original file line number Diff line number Diff line change @@ -531,9 +531,13 @@ impl PyInt {
531
531
zelf
532
532
}
533
533
534
- #[ pymethod ]
534
+ #[ pyclassmethod ]
535
535
#[ allow( clippy:: match_bool) ]
536
- fn from_bytes ( args : IntFromByteArgs , vm : & VirtualMachine ) -> PyResult < BigInt > {
536
+ fn from_bytes (
537
+ cls : PyClassRef ,
538
+ args : IntFromByteArgs ,
539
+ vm : & VirtualMachine ,
540
+ ) -> PyResult < PyRef < Self > > {
537
541
let signed = if let OptionalArg :: Present ( signed) = args. signed {
538
542
signed. to_bool ( )
539
543
} else {
@@ -555,7 +559,7 @@ impl PyInt {
555
559
)
556
560
}
557
561
} ;
558
- Ok ( x )
562
+ PyInt :: new ( x ) . into_ref_with_type ( vm , cls )
559
563
}
560
564
561
565
#[ pymethod]
You can’t perform that action at this time.
0 commit comments