@@ -6,7 +6,7 @@ use crate::py_result_ext::PyResultExt;
6
6
use crate :: sync:: GILOnceCell ;
7
7
use crate :: type_object:: PyTypeInfo ;
8
8
use crate :: types:: any:: PyAnyMethods ;
9
- use crate :: types:: { PyAny , PyDict , PySequence , PyType } ;
9
+ use crate :: types:: { PyAny , PyDict , PyList , PyType } ;
10
10
use crate :: { ffi, Py , PyTypeCheck , Python } ;
11
11
12
12
/// Represents a reference to a Python object supporting the mapping protocol.
@@ -77,14 +77,14 @@ pub trait PyMappingMethods<'py>: crate::sealed::Sealed {
77
77
where
78
78
K : IntoPyObject < ' py > ;
79
79
80
- /// Returns a sequence containing all keys in the mapping.
81
- fn keys ( & self ) -> PyResult < Bound < ' py , PySequence > > ;
80
+ /// Returns a list containing all keys in the mapping.
81
+ fn keys ( & self ) -> PyResult < Bound < ' py , PyList > > ;
82
82
83
- /// Returns a sequence containing all values in the mapping.
84
- fn values ( & self ) -> PyResult < Bound < ' py , PySequence > > ;
83
+ /// Returns a list containing all values in the mapping.
84
+ fn values ( & self ) -> PyResult < Bound < ' py , PyList > > ;
85
85
86
- /// Returns a sequence of tuples of all (key, value) pairs in the mapping.
87
- fn items ( & self ) -> PyResult < Bound < ' py , PySequence > > ;
86
+ /// Returns a list of all (key, value) pairs in the mapping.
87
+ fn items ( & self ) -> PyResult < Bound < ' py , PyList > > ;
88
88
}
89
89
90
90
impl < ' py > PyMappingMethods < ' py > for Bound < ' py , PyMapping > {
@@ -133,7 +133,7 @@ impl<'py> PyMappingMethods<'py> for Bound<'py, PyMapping> {
133
133
}
134
134
135
135
#[ inline]
136
- fn keys ( & self ) -> PyResult < Bound < ' py , PySequence > > {
136
+ fn keys ( & self ) -> PyResult < Bound < ' py , PyList > > {
137
137
unsafe {
138
138
ffi:: PyMapping_Keys ( self . as_ptr ( ) )
139
139
. assume_owned_or_err ( self . py ( ) )
@@ -142,7 +142,7 @@ impl<'py> PyMappingMethods<'py> for Bound<'py, PyMapping> {
142
142
}
143
143
144
144
#[ inline]
145
- fn values ( & self ) -> PyResult < Bound < ' py , PySequence > > {
145
+ fn values ( & self ) -> PyResult < Bound < ' py , PyList > > {
146
146
unsafe {
147
147
ffi:: PyMapping_Values ( self . as_ptr ( ) )
148
148
. assume_owned_or_err ( self . py ( ) )
@@ -151,7 +151,7 @@ impl<'py> PyMappingMethods<'py> for Bound<'py, PyMapping> {
151
151
}
152
152
153
153
#[ inline]
154
- fn items ( & self ) -> PyResult < Bound < ' py , PySequence > > {
154
+ fn items ( & self ) -> PyResult < Bound < ' py , PyList > > {
155
155
unsafe {
156
156
ffi:: PyMapping_Items ( self . as_ptr ( ) )
157
157
. assume_owned_or_err ( self . py ( ) )
0 commit comments