C# (CSharp) Python.Runtime ConstructorBinding - 5개의 예제가 발견되었습니다. 이것들은 오픈소스 프로젝트에서 추출된 C# (CSharp)의 Python.Runtime.ConstructorBinding에 대한 실세계 최고 등급의 예제들입니다. 예제들을 평가하여 예제의 품질 향상에 도움을 줄 수 있습니다.
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.