Beispiel #1
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.Remove(key);
                return(ret);
            }
            else
            {
                return(defaultValue);
            }
        }
Beispiel #2
0
        public static object pop(PythonDictionary self, object key)
        {
            //??? perf won't match expected Python perf
            object ret;

            if (self.TryGetValueNoMissing(key, out ret))
            {
                self.Remove(key);
                return(ret);
            }
            else
            {
                throw PythonOps.KeyError(key);
            }
        }
Beispiel #3
0
 /// <summary>
 /// Removes a variable from the local scope.
 /// </summary>
 internal bool TryRemoveVariable(string name)
 {
     return(Dict.Remove(name));
 }