Skip to content

Conversation

@tleonhardt
Copy link
Member

Fix bug when the with_argument_list decorator is called with the optional preserve_quotes argument.

This closes #633

@tleonhardt tleonhardt added the bug label Mar 5, 2019
@tleonhardt tleonhardt added this to the 0.9.11 milestone Mar 5, 2019
@tleonhardt tleonhardt self-assigned this Mar 5, 2019
@tleonhardt tleonhardt requested a review from kmvanbrunt March 5, 2019 01:53
@tleonhardt tleonhardt requested a review from kotfu as a code owner March 5, 2019 01:53
@codecov
Copy link

codecov bot commented Mar 5, 2019

Codecov Report

Merging #636 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #636      +/-   ##
==========================================
+ Coverage   94.21%   94.22%   +<.01%     
==========================================
  Files          11       11              
  Lines        3010     3014       +4     
==========================================
+ Hits         2836     2840       +4     
  Misses        174      174
Impacted Files Coverage Δ
cmd2/cmd2.py 94.24% <100%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dddf5d0...d1a970b. Read the comment docs.


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]]:
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kmvanbrunt
kmvanbrunt previously approved these changes Mar 5, 2019
@tleonhardt tleonhardt merged commit 04eac4b into master Mar 5, 2019
@tleonhardt tleonhardt deleted the with_argument_list branch March 5, 2019 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

with_argument_list breaks when using preserve_quotes argument

3 participants