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

Decorator chain using explicit arguments #82

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

iartarisi
Copy link

If one of the decorators in the chain of a method's decorators specifies
(at least one) of its parameter names explicitly, classy fails to build
a correct route for it. The get_true_argspec function will stop at
that decorator because it has found that its first argument is self.

This pull request contains a failing test which points out the issue. I
haven't figured out a fix yet.

We will later make it fail, but want to show a nice diff in the next
commit.
Use one of the args explicitly in one of the decorators. This makes
sure, that the function which tries to get to the bottom of the
decorator chain, doesn't just look for the first function with named
parameters.
@iartarisi iartarisi force-pushed the inner-params-decorator branch from 5ad464b to 05f6d40 Compare August 31, 2015 22:11
The undecorated library provides a more robust way of getting access to
the original method without any decorators applied. It also supports
decorators with explicitly named parameters (which the existing
true_argspec method did not support).
@iartarisi
Copy link
Author

I have now found a solution to this and packaged it in the undecorated library on pypi. I have added a commit which uses it to fix the broken test case.

@auvipy
Copy link

auvipy commented Oct 25, 2016

@apiguy can you check this?

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 this pull request may close these issues.

2 participants