@@ -1009,6 +1009,11 @@ internal static string PyObject_GetTypeName(IntPtr op)
10091009 return Marshal . PtrToStringAnsi ( ppName ) ;
10101010 }
10111011
1012+ /// <summary>
1013+ /// Test whether the Python object is an iterable.
1014+ /// </summary>
1015+ internal static bool PyObject_IsIterable ( BorrowedReference ob )
1016+ => PyObject_IsIterable ( ob . DangerousGetAddress ( ) ) ;
10121017 /// <summary>
10131018 /// Test whether the Python object is an iterable.
10141019 /// </summary>
@@ -1078,7 +1083,10 @@ internal static IntPtr PyObject_GetAttr(IntPtr pointer, IntPtr name)
10781083 internal static IntPtr PyObject_Call ( IntPtr pointer , IntPtr args , IntPtr kw ) => Delegates . PyObject_Call ( pointer , args , kw ) ;
10791084
10801085
1081- internal static IntPtr PyObject_CallObject ( IntPtr pointer , IntPtr args ) => Delegates . PyObject_CallObject ( pointer , args ) ;
1086+ internal static NewReference PyObject_CallObject ( BorrowedReference callable , BorrowedReference args ) => Delegates . PyObject_CallObject ( callable , args ) ;
1087+ internal static IntPtr PyObject_CallObject ( IntPtr pointer , IntPtr args )
1088+ => Delegates . PyObject_CallObject ( new BorrowedReference ( pointer ) , new BorrowedReference ( args ) )
1089+ . DangerousMoveToPointerOrNull ( ) ;
10821090
10831091
10841092 internal static int PyObject_RichCompareBool ( IntPtr value1 , IntPtr value2 , int opid ) => Delegates . PyObject_RichCompareBool ( value1 , value2 , opid ) ;
@@ -1880,6 +1888,7 @@ internal static IntPtr PyTuple_GetSlice(IntPtr pointer, long start, long end)
18801888 //====================================================================
18811889 // Python iterator API
18821890 //====================================================================
1891+ internal static bool PyIter_Check ( BorrowedReference ob ) => PyIter_Check ( ob . DangerousGetAddress ( ) ) ;
18831892
18841893 internal static bool PyIter_Check ( IntPtr pointer )
18851894 {
@@ -2317,7 +2326,7 @@ static Delegates()
23172326 PyObject_DelItem = ( delegate * unmanaged[ Cdecl] < IntPtr , IntPtr , int > ) GetFunctionByName ( nameof ( PyObject_DelItem ) , GetUnmanagedDll ( _PythonDll ) ) ;
23182327 PyObject_GetIter = ( delegate * unmanaged[ Cdecl] < IntPtr , IntPtr > ) GetFunctionByName ( nameof ( PyObject_GetIter ) , GetUnmanagedDll ( _PythonDll ) ) ;
23192328 PyObject_Call = ( delegate * unmanaged[ Cdecl] < IntPtr , IntPtr , IntPtr , IntPtr > ) GetFunctionByName ( nameof ( PyObject_Call ) , GetUnmanagedDll ( _PythonDll ) ) ;
2320- PyObject_CallObject = ( delegate * unmanaged[ Cdecl] < IntPtr , IntPtr , IntPtr > ) GetFunctionByName ( nameof ( PyObject_CallObject ) , GetUnmanagedDll ( _PythonDll ) ) ;
2329+ PyObject_CallObject = ( delegate * unmanaged[ Cdecl] < BorrowedReference , BorrowedReference , NewReference > ) GetFunctionByName ( nameof ( PyObject_CallObject ) , GetUnmanagedDll ( _PythonDll ) ) ;
23212330 PyObject_RichCompareBool = ( delegate * unmanaged[ Cdecl] < IntPtr , IntPtr , int , int > ) GetFunctionByName ( nameof ( PyObject_RichCompareBool ) , GetUnmanagedDll ( _PythonDll ) ) ;
23222331 PyObject_IsInstance = ( delegate * unmanaged[ Cdecl] < IntPtr , IntPtr , int > ) GetFunctionByName ( nameof ( PyObject_IsInstance ) , GetUnmanagedDll ( _PythonDll ) ) ;
23232332 PyObject_IsSubclass = ( delegate * unmanaged[ Cdecl] < BorrowedReference , BorrowedReference , int > ) GetFunctionByName ( nameof ( PyObject_IsSubclass ) , GetUnmanagedDll ( _PythonDll ) ) ;
@@ -2616,7 +2625,7 @@ static Delegates()
26162625 internal static delegate * unmanaged[ Cdecl] < IntPtr , IntPtr , int > PyObject_DelItem { get ; }
26172626 internal static delegate * unmanaged[ Cdecl] < IntPtr , IntPtr > PyObject_GetIter { get ; }
26182627 internal static delegate * unmanaged[ Cdecl] < IntPtr , IntPtr , IntPtr , IntPtr > PyObject_Call { get ; }
2619- internal static delegate * unmanaged[ Cdecl] < IntPtr , IntPtr , IntPtr > PyObject_CallObject { get ; }
2628+ internal static delegate * unmanaged[ Cdecl] < BorrowedReference , BorrowedReference , NewReference > PyObject_CallObject { get ; }
26202629 internal static delegate * unmanaged[ Cdecl] < IntPtr , IntPtr , int , int > PyObject_RichCompareBool { get ; }
26212630 internal static delegate * unmanaged[ Cdecl] < IntPtr , IntPtr , int > PyObject_IsInstance { get ; }
26222631 internal static delegate * unmanaged[ Cdecl] < BorrowedReference , BorrowedReference , int > PyObject_IsSubclass { get ; }
0 commit comments