Skip to content

Commit 7980b78

Browse files
authored
Merge pull request RustPython#1541 from ashermancinelli/int-sizeof
`int.__sizeof__` from RustPython#1426
2 parents be4a3f3 + ccd61b9 commit 7980b78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vm/src/obj/objint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ impl PyInt {
576576

577577
#[pymethod(name = "__sizeof__")]
578578
fn sizeof(&self, _vm: &VirtualMachine) -> usize {
579-
size_of::<Self>()
579+
size_of::<Self>() + ((self.value.bits() + 7) & !7) / 8
580580
}
581581

582582
#[pymethod]

0 commit comments

Comments
 (0)