Esempio n. 1
0
 public static object pop(PythonDictionary self, object key)
 {
     //??? perf won't match expected Python perf
     if (self.TryGetValueNoMissing(key, out object ret))
     {
         self.RemoveDirect(key);
         return(ret);
     }
     else
     {
         throw PythonOps.KeyError(key);
     }
 }
Esempio n. 2
0
        public static object pop(PythonDictionary self, object key, object defaultValue)
        {
            //??? perf won't match expected Python perf
            object ret;

            if (self.TryGetValueNoMissing(key, out ret))
            {
                self.RemoveDirect(key);
                return(ret);
            }
            else
            {
                return(defaultValue);
            }
        }