@@ -285,6 +285,11 @@ internal static void Initialize(bool initSigs = false)
285
285
( ) => PyFloatType = IntPtr . Zero ) ;
286
286
XDecref ( op ) ;
287
287
288
+ op = PyCell_New ( ) ;
289
+ SetPyMember ( ref PyCellType , PyObject_Type ( op ) ,
290
+ ( ) => PyCellType = IntPtr . Zero ) ;
291
+ // XDecref(op);
292
+
288
293
#if ! PYTHON2
289
294
PyClassType = IntPtr . Zero ;
290
295
PyInstanceType = IntPtr . Zero ;
@@ -452,6 +457,7 @@ private static void ResetPyMembers()
452
457
internal static IntPtr PyBoolType ;
453
458
internal static IntPtr PyNoneType ;
454
459
internal static IntPtr PyTypeType ;
460
+ internal static IntPtr PyCellType ;
455
461
456
462
internal static IntPtr Py_NoSiteFlag ;
457
463
@@ -1965,6 +1971,18 @@ internal static IntPtr PyMem_Realloc(IntPtr ptr, long size)
1965
1971
[ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
1966
1972
internal static extern void PyErr_Print( ) ;
1967
1973
1974
+ //====================================================================
1975
+ // Cell API
1976
+ //====================================================================
1977
+
1978
+ [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
1979
+ internal static extern IntPtr PyCell_New( ) ;
1980
+
1981
+ [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
1982
+ internal static extern NewReference PyCell_Get( IntPtr cell) ;
1983
+
1984
+ [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
1985
+ internal static extern int PyCell_Set( IntPtr cell, IntPtr value) ;
1968
1986
1969
1987
//====================================================================
1970
1988
// Miscellaneous
0 commit comments