C# Class IronPython.Runtime.Binding.PythonProtocol.Callable

Base class for calling indexers. We have two subclasses that target built-in functions & user defined callable objects. The Callable objects get handed off to ItemBuilder's which then call them with the appropriate arguments.
Mostra file Open project: jschementi/iron

Public Methods

Method Description
CompleteRuleTarget ( DynamicMetaObjectBinder metaBinder, DynamicMetaObject args, Func customFailure ) : DynamicMetaObject

Adds the target of the call to the rule.

GetTupleArguments ( DynamicMetaObject arguments ) : DynamicMetaObject[]

Gets the arguments in a form that should be used for extended slicing. Python defines that multiple tuple arguments received (x[1,2,3]) get packed into a Tuple. For most .NET methods we just want to expand this into the multiple index arguments. For slots and old-instances we want to pass in the tuple

MakeCallable ( PythonContext binder, PythonIndexType op, IronPython.Runtime.Types.BuiltinFunction itemFunc, PythonTypeSlot itemSlot ) : Callable

Creates a new CallableObject. If BuiltinFunction is available we'll create a BuiltinCallable otherwise we create a SlotCallable.

Protected Methods

Method Description
Callable ( PythonContext binder, PythonIndexType op ) : System.Linq.Expressions

Method Details

Callable() protected method

protected Callable ( PythonContext binder, PythonIndexType op ) : System.Linq.Expressions
binder PythonContext
op PythonIndexType
return System.Linq.Expressions

CompleteRuleTarget() public abstract method

Adds the target of the call to the rule.
public abstract CompleteRuleTarget ( DynamicMetaObjectBinder metaBinder, DynamicMetaObject args, Func customFailure ) : DynamicMetaObject
metaBinder DynamicMetaObjectBinder
args DynamicMetaObject
customFailure Func
return DynamicMetaObject

GetTupleArguments() public method

Gets the arguments in a form that should be used for extended slicing. Python defines that multiple tuple arguments received (x[1,2,3]) get packed into a Tuple. For most .NET methods we just want to expand this into the multiple index arguments. For slots and old-instances we want to pass in the tuple
public GetTupleArguments ( DynamicMetaObject arguments ) : DynamicMetaObject[]
arguments DynamicMetaObject
return DynamicMetaObject[]

MakeCallable() public static method

Creates a new CallableObject. If BuiltinFunction is available we'll create a BuiltinCallable otherwise we create a SlotCallable.
public static MakeCallable ( PythonContext binder, PythonIndexType op, IronPython.Runtime.Types.BuiltinFunction itemFunc, PythonTypeSlot itemSlot ) : Callable
binder PythonContext
op PythonIndexType
itemFunc IronPython.Runtime.Types.BuiltinFunction
itemSlot IronPython.Runtime.Types.PythonTypeSlot
return Callable