Decorator chain using explicit arguments#82
Open
iartarisi wants to merge 3 commits into
Open
Conversation
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.
5ad464b to
05f6d40
Compare
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).
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. |
|
@apiguy can you check this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_argspecfunction will stop atthat 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.