PyObject_DelItem() private méthode

private PyObject_DelItem ( IntPtr pointer, IntPtr key ) : int
pointer IntPtr
key IntPtr
Résultat int
Exemple #1
0
        /// <summary>
        /// DelItem Method
        /// </summary>
        /// <remarks>
        /// For objects that support the Python sequence or mapping protocols,
        /// delete the item at the given object index. This method raises a
        /// PythonException if the delete operation fails.
        /// </remarks>
        public virtual void DelItem(PyObject key)
        {
            int r = Runtime.PyObject_DelItem(obj, key.obj);

            if (r < 0)
            {
                throw new PythonException();
            }
        }
Exemple #2
0
 /// <summary>
 /// Remove Method
 /// </summary>
 /// <remarks>
 /// Remove a variable from the variables dict.
 /// </remarks>
 public void Remove(string name)
 {
     Check();
     using (var pyKey = new PyString(name))
     {
         int r = Runtime.PyObject_DelItem(variables, pyKey.obj);
         if (r < 0)
         {
             throw new PythonException();
         }
     }
 }
Exemple #3
0
        /// <summary>
        /// DelItem Method
        /// </summary>
        /// <remarks>
        /// For objects that support the Python sequence or mapping protocols,
        /// delete the item at the given object index. This method raises a
        /// PythonException if the delete operation fails.
        /// </remarks>
        public virtual void DelItem(PyObject key)
        {
            if (key == null)
            {
                throw new ArgumentNullException(nameof(key));
            }

            int r = Runtime.PyObject_DelItem(obj, key.obj);

            if (r < 0)
            {
                throw new PythonException();
            }
        }