-
Notifications
You must be signed in to change notification settings - Fork 247
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(python): support inheritance-based interface implementation #3350
Draft
RomainMuller
wants to merge
22
commits into
main
Choose a base branch
from
rmuller/python-interfaces
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+865
−595
Commits on Jan 24, 2022
-
feat(python): support inheritance-based interface implementation
The code generator used to represent jsii interfaces as python `Protocols`, however this mechanism is normally intended to allow structural typing in python. Python `Protocol` types are declared using a custom metaclass, which makes them tricky to inherit from without running into metaclass conflicts (especially in cases where multiple inheritance involving a `Protocol` and a non-`Protocol` base class). The jsii runtime does not perform structural typing, and hence interfaces are better modelled as abstract base classes that only declare abstract members. This, together with a minor modification to the `@jsii.interface` decorator, allows interfaces to be "implemented" by simply adding them to the implementor's inheritance chain, as is "natural" to do in Python in such cases. The "legacy" `@jsii.implements` approach to implementing interfaces is no longer recommended, however it is still supported as it is necessary when dealing with libraries generated by older versions of `jsii-pacmak`.
Configuration menu - View commit details
-
Copy full SHA for 7a0ee64 - Browse repository at this point
Copy the full SHA 7a0ee64View commit details -
Merge branch 'main' into rmuller/python-interfaces
Romain Marcadier authoredJan 24, 2022 Configuration menu - View commit details
-
Copy full SHA for 5e61e84 - Browse repository at this point
Copy the full SHA 5e61e84View commit details -
Configuration menu - View commit details
-
Copy full SHA for e5259ea - Browse repository at this point
Copy the full SHA e5259eaView commit details
Commits on Jan 25, 2022
-
Configuration menu - View commit details
-
Copy full SHA for bfa7492 - Browse repository at this point
Copy the full SHA bfa7492View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5a6b6e3 - Browse repository at this point
Copy the full SHA 5a6b6e3View commit details -
Romain Marcadier authored
Jan 25, 2022 Configuration menu - View commit details
-
Copy full SHA for 742e12e - Browse repository at this point
Copy the full SHA 742e12eView commit details
Commits on Jan 26, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 31feec8 - Browse repository at this point
Copy the full SHA 31feec8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 715a3f7 - Browse repository at this point
Copy the full SHA 715a3f7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7c7da80 - Browse repository at this point
Copy the full SHA 7c7da80View commit details -
Configuration menu - View commit details
-
Copy full SHA for ae365fc - Browse repository at this point
Copy the full SHA ae365fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2424392 - Browse repository at this point
Copy the full SHA 2424392View commit details
Commits on Jan 27, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 9e0d3c5 - Browse repository at this point
Copy the full SHA 9e0d3c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2bae124 - Browse repository at this point
Copy the full SHA 2bae124View commit details -
Merge branch 'main' into rmuller/python-interfaces
Romain Marcadier authoredJan 27, 2022 Configuration menu - View commit details
-
Copy full SHA for 9eaa38e - Browse repository at this point
Copy the full SHA 9eaa38eView commit details
Commits on Jan 28, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 2eb82ed - Browse repository at this point
Copy the full SHA 2eb82edView commit details -
Configuration menu - View commit details
-
Copy full SHA for 261f204 - Browse repository at this point
Copy the full SHA 261f204View commit details -
Configuration menu - View commit details
-
Copy full SHA for e96331c - Browse repository at this point
Copy the full SHA e96331cView commit details -
Configuration menu - View commit details
-
Copy full SHA for aa4af36 - Browse repository at this point
Copy the full SHA aa4af36View commit details -
Merge branch 'main' into rmuller/python-interfaces
Romain Marcadier authoredJan 28, 2022 Configuration menu - View commit details
-
Copy full SHA for dd3b01b - Browse repository at this point
Copy the full SHA dd3b01bView commit details
Commits on Jan 31, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 3d471d8 - Browse repository at this point
Copy the full SHA 3d471d8View commit details
Commits on Feb 8, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 342b5c4 - Browse repository at this point
Copy the full SHA 342b5c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5885996 - Browse repository at this point
Copy the full SHA 5885996View commit details
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.