Merge ~cjwatson/launchpad-layers:endpoint-from-flag into launchpad-layers:main
Status: | Merged |
---|---|
Merged at revision: | e4d85d4993268ca4c484c3e0b2715886159c9018 |
Proposed branch: | ~cjwatson/launchpad-layers:endpoint-from-flag |
Merge into: | launchpad-layers:main |
Diff against target: |
49 lines (+14/-4) 1 file modified
launchpad-base/reactive/launchpad-base.py (+14/-4) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email: mp+439082@code.launchpad.net |
Commit message
Use endpoint_from_flag rather than handler arguments
Description of the change
https:/
says:
For backwards compatibility, some decorators will pass endpoint
instances if the handler function specifies them as arguments.
However, explicit instance access using `endpoint_
recommended, because ensuring proper argument order can be confusing:
they are passed in bottom-up, left-to-right, and no negative or
ambiguous decorators, such as `when_not()` or `when_any()` will ever
pass arguments.
I also ran into some weird behaviour during an `upgrade-charm` attempt where the backward-
Not entirely tested as yet, but I'll be able to test this properly when integrating it into the Launchpad charms.