Object identity, Interfaces and Attributes#2019
Closed
rmadsen-ks wants to merge 15 commits intopythonnet:masterfrom
Closed
Object identity, Interfaces and Attributes#2019rmadsen-ks wants to merge 15 commits intopythonnet:masterfrom
rmadsen-ks wants to merge 15 commits intopythonnet:masterfrom
Conversation
Added a unit test which consists ofa python class inheriting from a C# class which has a virtual generic method. In this version, this causes a InvalidProgramException to be thrown during class creation.
Previously an exception was thrown during class creation if the python class inherited from a class with a virtual generic method. This has been fixed by ignoring generic methods when creating overloads in the generated class. Note, this means that generic virtual methods cannot be overridden in python code.
- Changed the behavior so that a .NET is always created when the base type is also a .NET type.
- Added shortened Attribute aliases which just generates tuples. - More general CLR base class support - creating a class instance from C# is now more similar to creating one from python. - Added attribute decorator to clr.py. - Added testing for the various possibilities
- Fixed search bug in AssocAttribute - Added testing
… inside a .NET module.
Added support for specifying attributes on property-methods (eg. get/set attributes).
…eritGenericVirtualMethodFix2
Added a few cleanups and comments.
lostmsu
reviewed
Nov 29, 2022
Comment on lines
+152
to
+156
| if (!clsDict.HasKey("__namespace__")) | ||
| { | ||
| clsDict["__namespace__"] = | ||
| (clsDict["__module__"].ToString()).ToPython(); | ||
| } |
Member
There was a problem hiding this comment.
Can't introduce breaking changes
Comment on lines
+20
to
+21
| Python.Runtime.Runtime.PythonDLL = | ||
| "C:\\Python37.2\\python37.dll"; |
Comment on lines
+17
to
+21
| /// <summary> | ||
| /// Creates a new instance of PythonTypeAttribute. | ||
| /// </summary> | ||
| /// <param name="pyTypeModule"></param> | ||
| /// <param name="pyTypeName"></param> |
Member
There was a problem hiding this comment.
This XML doc does not have any useful information.
Member
Contributor
Author
|
@lostmsu, ok, I understand. I just want to make sure you agree with the intentions here before I spend a lot of work trying to separate things out. What about the support for Attributes and interfaces? Are you ok with adding something like that? Anyway, it sounds like you want #1774 implemented in a specific way? Maybe it is easier that it is not me who develops that then? I'll try to take #1776 and create a separate PR for it. |
Contributor
Author
Member
|
Superseded by smaller changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains multiple improvements:
@attribute(Browsable(False)), or clr_attributes = [Browsable(False), ...]property(Double,0.0).add_attribute(DisplayName("X")Close #1776, #1774, #1768
Check all those that are applicable and complete.
AUTHORSCHANGELOG