Skip to content

Wrappers as decorators #42

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

Merged
merged 16 commits into from
Sep 15, 2019
Merged

Wrappers as decorators #42

merged 16 commits into from
Sep 15, 2019

Conversation

lukelbd
Copy link
Collaborator

@lukelbd lukelbd commented Sep 15, 2019

This addresses #37. Wrappers are now implemented in axes.Axes, with the succinct syntax e.g. plot = wrapper1(wrapper2(Axes.plot)) rather than the more verbose decorator syntax. This is a major improvement, because it means we are no longer messing with __getattribute__. It also means we can begin to apply method-specific behavior in e.g. plot, contourf, pcolormesh, etc. methods, rather than querying func.__name__ inside complex wrappers (e.g. cmap_wrapper) to apply method-specific behavior. This is just a starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant