Exemplo n.º 1
0
            public object Call(CodeContext/*!*/ context, [ParamDictionary]IDictionary<object, object> dict, params object[] args) {

                IDictionary<object, object> finalDict;
                if (_keywordArgs != null) {
                    PythonDictionary pd = new PythonDictionary();
                    pd.update(context, _keywordArgs);
                    pd.update(context, dict);

                    finalDict = pd;
                } else {
                    finalDict = dict;
                }

                EnsureDictSplatSite();
                return _dictSite.Target(_dictSite, context, _function, ArrayUtils.AppendRange(_args, args), finalDict);
            }
 UpdateMethodTableObj(PythonDictionary methodTable, object potentialMethodSource)
 {
     if (Builtin.hasattr(this.scratchContext, potentialMethodSource, "_dispatcher"))
     {
         PythonDictionary methodSource = (PythonDictionary)Builtin.getattr(
             this.scratchContext, Builtin.getattr(
                 this.scratchContext, potentialMethodSource, "_dispatcher"), "table");
         methodTable.update(this.scratchContext, methodSource);
     }
     this.Store(potentialMethodSource);
     return potentialMethodSource;
 }
Exemplo n.º 3
0
 UpdateMethodTableObj(PythonDictionary methodTable, object potentialMethodSource)
 {
     if (Builtin.hasattr(this.scratchContext, potentialMethodSource, "_dispatcher"))
     {
         PythonDictionary methodSource = (PythonDictionary)Builtin.getattr(
             this.scratchContext, Builtin.getattr(
                 this.scratchContext, potentialMethodSource, "_dispatcher"), "table");
         methodTable.update(this.scratchContext, methodSource);
     }
     this.Store(potentialMethodSource);
     return(potentialMethodSource);
 }
Exemplo n.º 4
0
 PyDict_Update(IntPtr dstPtr, IntPtr srcPtr)
 {
     try
     {
         PythonDictionary dst = (PythonDictionary)this.Retrieve(dstPtr);
         dst.update(this.scratchContext, this.Retrieve(srcPtr));
         return(0);
     }
     catch (Exception e)
     {
         this.LastException = e;
         return(-1);
     }
 }
Exemplo n.º 5
0
            public object Call(CodeContext/*!*/ context, [ParamDictionary]IDictionary<object, object> dict, params object[] args) {

                IDictionary<object, object> finalDict;
                if (_keywordArgs != null) {
                    PythonDictionary pd = new PythonDictionary();
                    pd.update(context, _keywordArgs);
                    pd.update(context, dict);

                    finalDict = pd;
                } else {
                    finalDict = dict;
                }

                EnsureDictSplatSite();
                return _dictSite.Target(_dictSite, context, _function, ArrayUtils.AppendRange(_args, args), finalDict);
            }