C# Class IronPython.Runtime.PythonFunction

Inheritance: IronPython.Runtime.Types.PythonTypeSlot, IWeakReferenceable, IPythonMembersList, IDynamicMetaObjectProvider, ICodeFormattable, Binding.IFastInvokable
显示文件 Open project: jschementi/iron Class Usage Examples

Private Properties

Property Type Description
AddRecursionDepth int
BadArgumentError System.Exception
BadKeywordArgumentError System.Exception
CalculatedCachedCompat int
Deletefunc_globals void
EnsureDict PythonDictionary
EnsureID void
GetSignatureString string
IDynamicMetaObjectProvider DynamicMetaObject
IMembersList IList
IPythonMembersList IList
IWeakReferenceable IronPython.Runtime.WeakRefTracker
IWeakReferenceable bool
IWeakReferenceable void
PythonFunction System.Linq.Expressions
TryGetValue bool

Public Methods

Method Description
PythonFunction ( CodeContext context, FunctionCode code, PythonDictionary globals, string name, PythonTuple defaults, PythonTuple closure ) : System.Linq.Expressions

Python ctor - maps to function.__new__ y = func(x.__code__, globals(), 'foo', None, (a, ))

__call__ ( CodeContext context ) : object
__call__ ( CodeContext context, object>.[ dict ) : object
__repr__ ( CodeContext context ) : string

Private Methods

Method Description
AddRecursionDepth ( int change ) : int
BadArgumentError ( int count ) : Exception
BadKeywordArgumentError ( int count ) : Exception
CalculatedCachedCompat ( ) : int

Calculates the _compat value which is used for call-compatibility checks for simple calls. Whenver any of the dependent values are updated this must be called again. The dependent values include: _nparams - this is readonly, and never requies an update _defaults - the user can mutate this (func_defaults) and that forces an update expand dict/list - based on nparams and flags, both read-only Bits are allocated as: 00003fff - Normal argument count 0fffb000 - Default count 10000000 - unused 20000000 - expand list 40000000 - expand dict 80000000 - unused Enforce recursion is added at runtime.

Deletefunc_globals ( ) : void
EnsureDict ( ) : PythonDictionary
EnsureID ( ) : void
GetSignatureString ( ) : string
IDynamicMetaObjectProvider ( Expression parameter ) : DynamicMetaObject
IMembersList ( ) : IList
IPythonMembersList ( CodeContext context ) : IList
IWeakReferenceable ( ) : IronPython.Runtime.WeakRefTracker
IWeakReferenceable ( IronPython.Runtime.WeakRefTracker value ) : bool
IWeakReferenceable ( IronPython.Runtime.WeakRefTracker value ) : void
PythonFunction ( CodeContext context, FunctionCode funcInfo, object modName, object defaults, MutableTuple closure ) : System.Linq.Expressions
TryGetValue ( CodeContext context, object instance, IronPython.Runtime.Types.PythonType owner, object &value ) : bool

Method Details

PythonFunction() public method

Python ctor - maps to function.__new__ y = func(x.__code__, globals(), 'foo', None, (a, ))
public PythonFunction ( CodeContext context, FunctionCode code, PythonDictionary globals, string name, PythonTuple defaults, PythonTuple closure ) : System.Linq.Expressions
context CodeContext
code FunctionCode
globals PythonDictionary
name string
defaults PythonTuple
closure PythonTuple
return System.Linq.Expressions

__call__() public method

public __call__ ( CodeContext context ) : object
context CodeContext
return object

__call__() public method

public __call__ ( CodeContext context, object>.[ dict ) : object
context CodeContext
dict object>.[
return object

__repr__() public method

public __repr__ ( CodeContext context ) : string
context CodeContext
return string