We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 887ffd1 commit 439b44eCopy full SHA for 439b44e
vm/src/builtins/int.rs
@@ -614,7 +614,7 @@ impl PyInt {
614
#[pymethod]
615
fn to_bytes(&self, args: IntToByteArgs, vm: &VirtualMachine) -> PyResult<PyBytes> {
616
let signed = args.signed.map_or(false, Into::into);
617
- let byte_len = args.length.try_to_primitive(vm)?;
+ let byte_len = args.length;
618
619
let value = self.as_bigint();
620
match value.sign() {
@@ -802,7 +802,9 @@ struct IntFromByteArgs {
802
803
#[derive(FromArgs)]
804
struct IntToByteArgs {
805
- length: PyIntRef,
+ #[pyarg(any, default = "1")]
806
+ length: usize,
807
+ #[pyarg(any, default = "ArgByteOrder::Big")]
808
byteorder: ArgByteOrder,
809
#[pyarg(named, optional)]
810
signed: OptionalArg<ArgIntoBool>,
0 commit comments