| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
was: tp_new implementation would call .NET constructor and return a fully constructed object now: Except for some special .NET types tp_new creates uninitialized .NET object, which is later initialized by calling __init__. __init__ is set using type dictionary to a MethodObject, that contains ConstructorInfo[] instead of MethodInfo[] This allows Python to: 1) freely override __init__ 2) when deriving from .NET types call base __init__ (e.g. .NET constructor), and choose the overload as needed fixes pythonnet#238
| Back | FazBrowse Home | New Git URL |
What does this implement/fix? Explain your changes.
Was:
tp_new implementation would call .NET constructor and return a fully constructed object
Now:
Except for some special .NET types tp_new creates uninitialized .NET object, which is later initialized by calling uninitialized_inst.__init__(...).
__init__ is set in type dictionary to a MethodObject, that contains ConstructorInfo[] instead of MethodInfo[]
This allows Python to:
Failing to call base __init__ in this scenario will lead to an undefined behavior.
Does this close any currently open issues?
fixes #238
Checklist
Check all those that are applicable and complete.