- Notifications
You must be signed in to change notification settings - Fork749
Improved Type Interop with CLR#2055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
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 |
lostmsu commentedJan 20, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Please, rebase on master if you are still willing to work on getting this PR in. |
@lostmsu Sure thing. Working on getting |
mhsmith commentedJul 11, 2023
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 |
Uh oh!
There was an error while loading.Please reload this page.
What does this implement/fix? Explain your changes.
This PR addresses these issues:
__namespace__
, more than once, would throwType Exists
exceptionsuper().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:
NotImplemented
exception.__namespace__
is not required to created aClassDerived
anymore. All python derived classes are now represented byClassDerived
in managed memory.ClassDerived
now caches generated types based on namespace, type name, and chain of base classes. This avoids regenerating types or throwingType Already Exists
exceptions. 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 fromBaseClass
and implementingBaseInterface1
andBaseInterface2
:Python.Runtime.Dynamic.BaseClass__BaseInterface1__BaseInterface2__main__SubClass
super().__init__()
pattern.super().method()
pattern.OriginalMethod
andRedirectedMethod
) are now used to mark the original and redirected virtual methods. The method name format forOriginalMethod
is 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.
AUTHORS
CHANGELOG