-
Notifications
You must be signed in to change notification settings - Fork 231
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
Accessing a class attribute that is a wrapt wrapped function will try and bind the function. #256
Comments
By the way, I really appreciate the work that went into this. |
Can you explain better why it is a problem for you and what you are trying to do? Since you are using If you want the wrapped function to be tolerant of bogus arguments you should use:
or filter them out in
|
It's not the behavior that I expected, since I assumed that a decorator such as
I would have assumed that the intended contract is that annotating any function in a python program with It appears this is not the case. E.g.:
|
Okay, am overlooking that you pointed out error arises from internal to wrapt and not when called by the wrapper. Let me think about it and I'll do some tests. |
Can you try |
Simple reproduction:
This returns:
If a bogus argument is supplied, then the error occurs when the underlying wrapped function is called.
leads to
A possible workaround is to store the function as as singleton list:
Which yields:
As far as I can tell the failing code is the check at line 666 😈 in
wrappers.py
:The text was updated successfully, but these errors were encountered: