Skip to content
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
wants to merge 22 commits into
base: main
Choose a base branch
from

Commits on Jan 24, 2022

  1. 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`.
    RomainMuller committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    7a0ee64 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'main' into rmuller/python-interfaces

    Romain Marcadier authored Jan 24, 2022
    Configuration menu
    Copy the full SHA
    5e61e84 View commit details
    Browse the repository at this point in the history
  3. linter fix

    RomainMuller committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    e5259ea View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2022

  1. fix snapshot

    RomainMuller committed Jan 25, 2022
    Configuration menu
    Copy the full SHA
    bfa7492 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5a6b6e3 View commit details
    Browse the repository at this point in the history
  3. Update python.md

    Romain Marcadier authored Jan 25, 2022
    Configuration menu
    Copy the full SHA
    742e12e View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2022

  1. Configuration menu
    Copy the full SHA
    31feec8 View commit details
    Browse the repository at this point in the history
  2. linter fix + version fix

    RomainMuller committed Jan 26, 2022
    Configuration menu
    Copy the full SHA
    715a3f7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7c7da80 View commit details
    Browse the repository at this point in the history
  4. fix typo

    RomainMuller committed Jan 26, 2022
    Configuration menu
    Copy the full SHA
    ae365fc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2424392 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2022

  1. Configuration menu
    Copy the full SHA
    9e0d3c5 View commit details
    Browse the repository at this point in the history
  2. linter fix

    RomainMuller committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    2bae124 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'main' into rmuller/python-interfaces

    Romain Marcadier authored Jan 27, 2022
    Configuration menu
    Copy the full SHA
    9eaa38e View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2022

  1. Configuration menu
    Copy the full SHA
    2eb82ed View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    261f204 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e96331c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    aa4af36 View commit details
    Browse the repository at this point in the history
  5. Merge branch 'main' into rmuller/python-interfaces

    Romain Marcadier authored Jan 28, 2022
    Configuration menu
    Copy the full SHA
    dd3b01b View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2022

  1. Configuration menu
    Copy the full SHA
    3d471d8 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2022

  1. Configuration menu
    Copy the full SHA
    342b5c4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5885996 View commit details
    Browse the repository at this point in the history