@@ -499,7 +499,7 @@ impl PyTTLCache {
499499 . map ( |x| !x)
500500 }
501501
502- fn items ( & self , py : pyo3 :: Python ) -> pyo3:: PyResult < pyo3:: Py < PyTTLCacheItems > > {
502+ fn items ( & self ) -> pyo3:: PyResult < pyo3:: Py < PyTTLCacheItems > > {
503503 let inner = self . 0 . get ( ) ;
504504
505505 let iter = inner. policy ( ) . iter ( inner. shared ( ) ) ;
@@ -513,10 +513,10 @@ impl PyTTLCache {
513513 gv,
514514 initial_gv,
515515 } ;
516- pyo3:: Py :: new ( py, result)
516+ pyo3:: Python :: attach ( |py| pyo3 :: Py :: new ( py, result) )
517517 }
518518
519- fn values ( & self , py : pyo3 :: Python ) -> pyo3:: PyResult < pyo3:: Py < PyTTLCacheValues > > {
519+ fn values ( & self ) -> pyo3:: PyResult < pyo3:: Py < PyTTLCacheValues > > {
520520 let inner = self . 0 . get ( ) ;
521521
522522 let iter = inner. policy ( ) . iter ( inner. shared ( ) ) ;
@@ -530,10 +530,10 @@ impl PyTTLCache {
530530 gv,
531531 initial_gv,
532532 } ;
533- pyo3:: Py :: new ( py, result)
533+ pyo3:: Python :: attach ( |py| pyo3 :: Py :: new ( py, result) )
534534 }
535535
536- fn keys ( & self , py : pyo3 :: Python ) -> pyo3:: PyResult < pyo3:: Py < PyTTLCacheKeys > > {
536+ fn keys ( & self ) -> pyo3:: PyResult < pyo3:: Py < PyTTLCacheKeys > > {
537537 let inner = self . 0 . get ( ) ;
538538
539539 let iter = inner. policy ( ) . iter ( inner. shared ( ) ) ;
@@ -547,12 +547,12 @@ impl PyTTLCache {
547547 gv,
548548 initial_gv,
549549 } ;
550- pyo3:: Py :: new ( py, result)
550+ pyo3:: Python :: attach ( |py| pyo3 :: Py :: new ( py, result) )
551551 }
552552
553553 #[ inline]
554- fn __iter__ ( & self , py : pyo3 :: Python ) -> pyo3:: PyResult < pyo3:: Py < PyTTLCacheKeys > > {
555- self . keys ( py )
554+ fn __iter__ ( & self ) -> pyo3:: PyResult < pyo3:: Py < PyTTLCacheKeys > > {
555+ self . keys ( )
556556 }
557557
558558 fn copy ( & self , py : pyo3:: Python ) -> pyo3:: PyResult < pyo3:: Py < Self > > {
@@ -735,10 +735,7 @@ impl PyTTLCache {
735735 Ok ( ( key. into ( ) , val, dur. as_secs_f64 ( ) ) )
736736 }
737737
738- fn items_with_expire (
739- & self ,
740- py : pyo3:: Python ,
741- ) -> pyo3:: PyResult < pyo3:: Py < PyTTLCacheItemsWithExpire > > {
738+ fn items_with_expire ( & self ) -> pyo3:: PyResult < pyo3:: Py < PyTTLCacheItemsWithExpire > > {
742739 let inner = self . 0 . get ( ) ;
743740
744741 let iter = inner. policy ( ) . iter ( inner. shared ( ) ) ;
@@ -752,7 +749,7 @@ impl PyTTLCache {
752749 gv,
753750 initial_gv,
754751 } ;
755- pyo3:: Py :: new ( py, result)
752+ pyo3:: Python :: attach ( |py| pyo3 :: Py :: new ( py, result) )
756753 }
757754
758755 fn __traverse__ ( & self , visit : pyo3:: PyVisit < ' _ > ) -> Result < ( ) , pyo3:: PyTraverseError > {
0 commit comments