@@ -31,8 +31,7 @@ mod array {
3131 AsBuffer , AsMapping , Comparable , Constructor , IterNext , IterNextIterable , Iterable ,
3232 PyComparisonOp ,
3333 } ,
34- AsObject , PyObject , PyObjectRef , PyObjectView , PyRef , PyResult , PyValue ,
35- VirtualMachine ,
34+ AsObject , Py , PyObject , PyObjectRef , PyPayload , PyRef , PyResult , VirtualMachine ,
3635 } ,
3736 } ;
3837 use itertools:: Itertools ;
@@ -583,7 +582,7 @@ mod array {
583582
584583 #[ pyattr]
585584 #[ pyclass( name = "array" ) ]
586- #[ derive( Debug , PyValue ) ]
585+ #[ derive( Debug , PyPayload ) ]
587586 pub struct PyArray {
588587 array : PyRwLock < ArrayContentType > ,
589588 exports : AtomicUsize ,
@@ -1152,7 +1151,7 @@ mod array {
11521151
11531152 impl Comparable for PyArray {
11541153 fn cmp (
1155- zelf : & PyObjectView < Self > ,
1154+ zelf : & Py < Self > ,
11561155 other : & PyObject ,
11571156 op : PyComparisonOp ,
11581157 vm : & VirtualMachine ,
@@ -1203,7 +1202,7 @@ mod array {
12031202 }
12041203
12051204 impl AsBuffer for PyArray {
1206- fn as_buffer ( zelf : & PyObjectView < Self > , _vm : & VirtualMachine ) -> PyResult < PyBuffer > {
1205+ fn as_buffer ( zelf : & Py < Self > , _vm : & VirtualMachine ) -> PyResult < PyBuffer > {
12071206 let array = zelf. read ( ) ;
12081207 let buf = PyBuffer :: new (
12091208 zelf. to_owned ( ) . into ( ) ,
@@ -1254,7 +1253,7 @@ mod array {
12541253 }
12551254
12561255 impl AsMapping for PyArray {
1257- fn as_mapping ( _zelf : & PyObjectView < Self > , _vm : & VirtualMachine ) -> PyMappingMethods {
1256+ fn as_mapping ( _zelf : & Py < Self > , _vm : & VirtualMachine ) -> PyMappingMethods {
12581257 Self :: MAPPING_METHODS
12591258 }
12601259 }
@@ -1280,7 +1279,7 @@ mod array {
12801279
12811280 #[ pyattr]
12821281 #[ pyclass( name = "array_iterator" ) ]
1283- #[ derive( Debug , PyValue ) ]
1282+ #[ derive( Debug , PyPayload ) ]
12841283 pub struct PyArrayIter {
12851284 position : AtomicUsize ,
12861285 array : PyArrayRef ,
@@ -1291,7 +1290,7 @@ mod array {
12911290
12921291 impl IterNextIterable for PyArrayIter { }
12931292 impl IterNext for PyArrayIter {
1294- fn next ( zelf : & PyObjectView < Self > , vm : & VirtualMachine ) -> PyResult < PyIterReturn > {
1293+ fn next ( zelf : & Py < Self > , vm : & VirtualMachine ) -> PyResult < PyIterReturn > {
12951294 let pos = zelf. position . fetch_add ( 1 , atomic:: Ordering :: SeqCst ) ;
12961295 let r = if let Some ( item) = zelf. array . read ( ) . get ( pos, vm) {
12971296 PyIterReturn :: Return ( item?)
0 commit comments