private PyObject_GetItem ( IntPtr pointer, IntPtr key ) : IntPtr | ||
pointer | IntPtr | |
key | IntPtr | |
return | IntPtr |
/// <summary> /// GetItem Method /// </summary> /// <remarks> /// For objects that support the Python sequence or mapping protocols, /// return the item at the given object index. This method raises a /// PythonException if the indexing operation fails. /// </remarks> public virtual PyObject GetItem(PyObject key) { IntPtr op = Runtime.PyObject_GetItem(obj, key.obj); if (op == IntPtr.Zero) { throw new PythonException(); } return(new PyObject(op)); }
/// <summary> /// GetItem Method /// </summary> /// <remarks> /// For objects that support the Python sequence or mapping protocols, /// return the item at the given object index. This method raises a /// PythonException if the indexing operation fails. /// </remarks> public virtual PyObject GetItem(PyObject key) { if (key == null) { throw new ArgumentNullException(nameof(key)); } IntPtr op = Runtime.PyObject_GetItem(obj, key.obj); if (op == IntPtr.Zero) { throw new PythonException(); } return(new PyObject(op)); }