11use crate :: object:: * ;
2+ #[ cfg( not( PyPy ) ) ]
23use crate :: pyport:: Py_ssize_t ;
4+ #[ cfg( not( PyPy ) ) ]
35use std:: ffi:: c_int;
46
7+ #[ cfg( not( PyPy ) ) ]
58opaque_struct ! ( pub PyDictKeysObject ) ;
69
710#[ cfg( Py_3_11 ) ]
11+ #[ cfg( not( PyPy ) ) ]
812opaque_struct ! ( pub PyDictValues ) ;
913
10- #[ cfg( not( GraalPy ) ) ]
14+ #[ cfg( not( any ( GraalPy , PyPy ) ) ) ]
1115#[ repr( C ) ]
1216#[ derive( Debug ) ]
1317pub struct PyDictObject {
@@ -28,11 +32,20 @@ pub struct PyDictObject {
2832 pub ma_values : * mut PyDictValues ,
2933}
3034
35+ #[ cfg( PyPy ) ]
36+ #[ repr( C ) ]
37+ #[ derive( Debug ) ]
38+ pub struct PyDictObject {
39+ pub ob_base : PyObject ,
40+ _tmpkeys : * mut PyObject ,
41+ }
42+
3143extern "C" {
3244 // skipped _PyDict_GetItem_KnownHash
3345 // skipped _PyDict_GetItemIdWithError
3446 // skipped _PyDict_GetItemStringWithError
3547 // skipped PyDict_SetDefault
48+ #[ cfg( not( PyPy ) ) ]
3649 pub fn _PyDict_SetItem_KnownHash (
3750 mp : * mut PyObject ,
3851 key : * mut PyObject ,
@@ -42,6 +55,7 @@ extern "C" {
4255 // skipped _PyDict_DelItem_KnownHash
4356 // skipped _PyDict_DelItemIf
4457 // skipped _PyDict_NewKeysForClass
58+ #[ cfg( not( PyPy ) ) ]
4559 pub fn _PyDict_Next (
4660 mp : * mut PyObject ,
4761 pos : * mut Py_ssize_t ,
@@ -51,6 +65,7 @@ extern "C" {
5165 ) -> c_int ;
5266 // skipped PyDict_GET_SIZE
5367 // skipped _PyDict_ContainsId
68+ #[ cfg( not( PyPy ) ) ]
5469 pub fn _PyDict_NewPresized ( minused : Py_ssize_t ) -> * mut PyObject ;
5570 // skipped _PyDict_MaybeUntrack
5671 // skipped _PyDict_HasOnlyStringKeys
@@ -72,12 +87,14 @@ extern "C" {
7287 // skipped _PyDictView_Intersect
7388
7489 #[ cfg( Py_3_10 ) ]
90+ #[ cfg( not( PyPy ) ) ]
7591 pub fn _PyDict_Contains_KnownHash (
7692 op : * mut PyObject ,
7793 key : * mut PyObject ,
7894 hash : crate :: Py_hash_t ,
7995 ) -> c_int ;
8096
8197 #[ cfg( not( Py_3_10 ) ) ]
98+ #[ cfg( not( PyPy ) ) ]
8299 pub fn _PyDict_Contains ( mp : * mut PyObject , key : * mut PyObject , hash : Py_ssize_t ) -> c_int ;
83100}
0 commit comments