mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
Add memoryview.__len__
This commit is contained in:
1 parent
a08b4568e2
commit
e4f80d0f17
1 file changed
+5
@@ -59,6 +59,11 @@ impl PyMemoryView {
|
||||
fn getitem(&self, needle: PyObjectRef, vm: &VirtualMachine) -> PyResult {
|
||||
vm.call_method(&self.obj_ref, "__getitem__", vec![needle])
|
||||
}
|
||||
|
||||
#[pymethod(magic)]
|
||||
fn len(&self, vm: &VirtualMachine) -> PyResult {
|
||||
vm.call_method(&self.obj_ref, "__len__", vec![])
|
||||
}
|
||||
}
|
||||
|
||||
impl PyValue for PyMemoryView {
|
||||
|
||||
Reference in new issue
Block a user