C# (CSharp) Python.Runtime ConstructorBinding - 5 examples found. These are the top rated real world C# (CSharp) examples of Python.Runtime.ConstructorBinding extracted from open source projects. You can rate examples to help us improve the quality of examples.
Implements a Python type that wraps a CLR ctor call. Constructor objects support a .Overloads[] syntax to allow explicit ctor overload selection.
ClassManager stores a ConstructorBinding instance in the class's __dict__['Overloads'] SomeType.Overloads[Type, ...] works like this: 1) Python retreives the Overloads attribute from this ClassObject's dictionary normally and finds a non-null tp_descr_get slot which is called by the interpreter and returns an IncRef()ed pyHandle to itself. 2) The ConstructorBinding object handles the [] syntax in its mp_subscript by matching the Type object parameters to a contructor overload using Type.GetConstructor() [NOTE: I don't know why method overloads are not searched the same way.] and creating the BoundContructor oject which contains ContructorInfo object. 3) In tp_call, if ctorInfo is not null, ctorBinder.InvokeRaw() is called.