Improved Type Interop with CLR#2055
Conversation
|
Hello. Would anyone help me get some information on the error on these test fails? I can not run the |
|
If it fails to run locally, check the output. You are probably missing the |
|
Please, rebase on master if you are still willing to work on getting this PR in. |
|
@lostmsu Sure thing. Working on getting |
|
As part of this work, it would be good for Python subclassing of CLR types to be properly documented (#674 (comment)). |
|
Closing this PR as it is too old. I have merged the 3.0.3 master into my fork so I can create new updated PRs |
What does this implement/fix? Explain your changes.
This PR addresses these issues:
__namespace__, more than once, would throwType Existsexceptionsuper().VirtualMethod()inside a python-derived virtual method, would result in an infinite loopDue to the nature of the changes, this is a single PR instead of multiple smaller ones.
After PR merge:
NotImplementedexception.__namespace__is not required to created aClassDerivedanymore. All python derived classes are now represented byClassDerivedin managed memory.ClassDerivednow caches generated types based on namespace, type name, and chain of base classes. This avoids regenerating types or throwingType Already Existsexceptions. A new format for generated type names include full name of base class and interfaces in the typename. The naming format still ends in the python type name to be backward compatible and passes the unit testsSubClass, deriving fromBaseClassand implementingBaseInterface1andBaseInterface2:Python.Runtime.Dynamic.BaseClass__BaseInterface1__BaseInterface2__main__SubClasssuper().__init__()pattern.super().method()pattern.OriginalMethodandRedirectedMethod) are now used to mark the original and redirected virtual methods. The method name format forOriginalMethodis changed to$"_BASEVIRTUAL__{name}"so it can handle calling original methods on base classes that does not match the name of current class. Previously this was not working.Does this close any currently open issues?
Potentially (no tests have been done to ensure these issues are resolved)
Any other comments?
...
Checklist
Check all those that are applicable and complete.
AUTHORSCHANGELOG