Merge lp:~salgado/lazr.delegates/extend-passthrough into lp:lazr.delegates
Proposed by
Guilherme Salgado
Status: | Merged |
---|---|
Approved by: | Gary Poster |
Approved revision: | 6 |
Merged at revision: | 5 |
Proposed branch: | lp:~salgado/lazr.delegates/extend-passthrough |
Merge into: | lp:lazr.delegates |
Diff against target: |
98 lines (+54/-7) 2 files modified
src/lazr/delegates/README.txt (+37/-3) src/lazr/delegates/_delegates.py (+17/-4) |
To merge this branch: | bzr merge lp:~salgado/lazr.delegates/extend-passthrough |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gary Poster | Approve | ||
Review via email: mp+30084@code.launchpad.net |
Description of the change
Extend Passthrough so that it takes an extra argument to which the context is adapted before getting/setting the attribute
This is going to be used in https:/
To post a comment you must log in.
merge-conditional
Looks great. A few remaining trivial cleanups.
orig_interface -> adaptation in "Passthrough's third argument (orig_interface) is optional..." (src/lazr/ delegates/ README. txt)
"...(although in practice anything that provides a __call__() method will do)..." -> "...(although in practice any callable will do)..." (src/lazr/ delegates/ README. txt)
"If adaptation is not None, the context is adapted into it before getting/setting the attribute." -> "If the ``adaptation`` argument is not None, it should be a callable. It will be called with the context, and should return an object that will have the delegated attribute. The ``adaptation`` argument is expected to be used with an interface, to adapt the context." (src/lazr/ delegates/ _delegates. py)
Thank you!
Gary