C# (CSharp) Python.Runtime ConstructorBinding - 5 примеров найдено. Это лучшие примеры C# (CSharp) кода для Python.Runtime.ConstructorBinding, полученные из open source проектов. Вы можете ставить оценку каждому примеру, чтобы помочь нам улучшить качество примеров.
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.