@@ -33,7 +33,7 @@ use crate::{
3333 IterNextIterable , Iterable , PyComparisonOp , Unconstructible , Unhashable ,
3434 } ,
3535 utils:: Either ,
36- AsObject , PyContext , PyObject , PyObjectRef , PyObjectView , PyPayload , PyRef , PyResult ,
36+ AsObject , Py , PyContext , PyObject , PyObjectRef , PyPayload , PyRef , PyResult ,
3737 TryFromBorrowedObject , TryFromObject , VirtualMachine ,
3838} ;
3939use bstr:: ByteSlice ;
@@ -303,7 +303,7 @@ impl PyByteArray {
303303 }
304304 }
305305
306- fn irepeat ( zelf : & crate :: PyObjectView < Self > , n : isize , vm : & VirtualMachine ) -> PyResult < ( ) > {
306+ fn irepeat ( zelf : & crate :: Py < Self > , n : isize , vm : & VirtualMachine ) -> PyResult < ( ) > {
307307 if n == 1 {
308308 return Ok ( ( ) ) ;
309309 }
@@ -714,7 +714,7 @@ impl PyByteArray {
714714
715715impl Comparable for PyByteArray {
716716 fn cmp (
717- zelf : & crate :: PyObjectView < Self > ,
717+ zelf : & crate :: Py < Self > ,
718718 other : & PyObject ,
719719 op : PyComparisonOp ,
720720 vm : & VirtualMachine ,
@@ -749,7 +749,7 @@ static BUFFER_METHODS: BufferMethods = BufferMethods {
749749} ;
750750
751751impl AsBuffer for PyByteArray {
752- fn as_buffer ( zelf : & PyObjectView < Self > , _vm : & VirtualMachine ) -> PyResult < PyBuffer > {
752+ fn as_buffer ( zelf : & Py < Self > , _vm : & VirtualMachine ) -> PyResult < PyBuffer > {
753753 Ok ( PyBuffer :: new (
754754 zelf. to_owned ( ) . into ( ) ,
755755 BufferDescriptor :: simple ( zelf. len ( ) , false ) ,
@@ -768,16 +768,13 @@ impl<'a> BufferResizeGuard<'a> for PyByteArray {
768768}
769769
770770impl AsMapping for PyByteArray {
771- fn as_mapping ( _zelf : & crate :: PyObjectView < Self > , _vm : & VirtualMachine ) -> PyMappingMethods {
771+ fn as_mapping ( _zelf : & crate :: Py < Self > , _vm : & VirtualMachine ) -> PyMappingMethods {
772772 Self :: MAPPING_METHODS
773773 }
774774}
775775
776776impl AsSequence for PyByteArray {
777- fn as_sequence (
778- _zelf : & PyObjectView < Self > ,
779- _vm : & VirtualMachine ,
780- ) -> Cow < ' static , PySequenceMethods > {
777+ fn as_sequence ( _zelf : & Py < Self > , _vm : & VirtualMachine ) -> Cow < ' static , PySequenceMethods > {
781778 Cow :: Borrowed ( & Self :: SEQUENCE_METHODS )
782779 }
783780}
@@ -877,7 +874,7 @@ impl Unconstructible for PyByteArrayIterator {}
877874
878875impl IterNextIterable for PyByteArrayIterator { }
879876impl IterNext for PyByteArrayIterator {
880- fn next ( zelf : & crate :: PyObjectView < Self > , vm : & VirtualMachine ) -> PyResult < PyIterReturn > {
877+ fn next ( zelf : & crate :: Py < Self > , vm : & VirtualMachine ) -> PyResult < PyIterReturn > {
881878 zelf. internal . lock ( ) . next ( |bytearray, pos| {
882879 let buf = bytearray. borrow_buf ( ) ;
883880 Ok ( PyIterReturn :: from_result (
0 commit comments