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

@Metric/@metricmethod break zope.interface validation of method signatures #15

Closed
jamadden opened this issue Aug 8, 2019 · 1 comment · Fixed by #21
Closed

@Metric/@metricmethod break zope.interface validation of method signatures #15

jamadden opened this issue Aug 8, 2019 · 1 comment · Fixed by #21

Comments

@jamadden
Copy link
Member

jamadden commented Aug 8, 2019

This surprised me today. I changed an interface signature and expected test failures to alert me that the implementations no longer correctly implemented the method (because I hadn't updated their signatures yet). But that didn't happen. It turns out that the call_with_metric wrapper that's being returned from the decorator takes *args, **kwargs and that's enough to break signature introspection as far as zope.interface is concerned.

Interestingly, it doesn't break signature display as far as IPython is concerned.

I'm not sure there's anything much we can do here other than document this.

@jamadden
Copy link
Member Author

jamadden commented Sep 3, 2019

We could add an environment variable that causes the decorator to become a no-op and return the function without wrapping it.

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

Successfully merging a pull request may close this issue.

1 participant