-
Notifications
You must be signed in to change notification settings - Fork 127
Fix bug in with_argument_list decorator #636
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #636 +/- ##
==========================================
+ Coverage 94.21% 94.22% +<.01%
==========================================
Files 11 11
Lines 3010 3014 +4
==========================================
+ Hits 2836 2840 +4
Misses 174 174
Continue to review full report at Codecov.
|
|
|
||
| def with_argument_list(func: Callable[[Statement], Optional[bool]], | ||
| preserve_quotes: bool = False) -> Callable[[List], Optional[bool]]: | ||
| def with_argument_list(*args: List[Callable], preserve_quotes: bool = False) -> Callable[[List], Optional[bool]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize this works, but I'm confused. Why is args a list of Callables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I am making use of the ability to gather all positional arguments into a list, sort of like a varargs in C/C++ combined with the feature that any arguments after that are keyword-only arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a better and more complete explanation: https://www.digitalocean.com/community/tutorials/how-to-use-args-and-kwargs-in-python-3
Fix bug when the
with_argument_list decoratoris called with the optionalpreserve_quotesargument.This closes #633