@@ -809,47 +809,6 @@ where
809
809
}
810
810
}
811
811
812
- // use crate::obj::objmemory::PyMemoryViewRef;
813
-
814
- // pub trait BufferProtocol {
815
- // // fn readonly(&self) -> bool;
816
- // fn as_memoryview(&self, vm: &VirtualMachine) -> PyResult<PyMemoryViewRef>;
817
- // }
818
-
819
- // impl<T: ?Sized + PyObjectPayload> BufferProtocol for PyObject<T> {
820
- // fn as_memoryview(&self, vm: &VirtualMachine) -> PyResult<PyMemoryViewRef> {
821
- // Err(vm.new_not_implemented_error("This object does not implement buffer protocol".to_owned()))
822
- // }
823
- // }
824
-
825
- // impl<T: PyObjectPayload> BufferProtocol for PyRef<T> {
826
- // fn as_memoryview(&self, vm: &VirtualMachine) -> PyResult<PyMemoryViewRef> {
827
- // self.obj.as_memoryview(vm)
828
- // }
829
- // }
830
-
831
- // impl<T: ?Sized + BufferProtocol> BufferProtocol for PyRc<T> {
832
- // fn as_memoryview(&self, vm: &VirtualMachine) -> PyResult<PyMemoryViewRef> {
833
- // (**self).as_memoryview(vm)
834
- // }
835
- // }
836
-
837
- // impl<T: BufferProtocol> BufferProtocol for &T {
838
- // fn as_memoryview(&self, vm: &VirtualMachine) -> PyResult<PyMemoryViewRef> {
839
- // (&**self).as_memoryview(vm)
840
- // }
841
- // }
842
-
843
- // impl BufferProtocol for PyObjectRef {
844
- // fn readonly(&self) -> bool {
845
- // match self.lease_class().name.as_str() {
846
- // "bytes" => false,
847
- // "bytearray" | "memoryview" => true,
848
- // _ => panic!("Bytes-Like type expected not {:?}", self),
849
- // }
850
- // }
851
- // }
852
-
853
812
impl fmt:: Debug for PyObject < dyn PyObjectPayload > {
854
813
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
855
814
write ! ( f, "[PyObj {:?}]" , & self . payload)