Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.4k
Remove redundant if check from argparser file.#8766
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1469,10 +1469,8 @@ def _get_optional_kwargs(self, *args, **kwargs): | ||
| # strings starting with two prefix characters are long options | ||
| option_strings.append(option_string) | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I don't think these checks are redundant. Consider The left hand side requires I do think these conditions could be combined, perhaps something like: if (option_string[0]inself.prefix_charsandlen(option_string)>1andoption_string[1]inself.prefix_chars): ... ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Please check the code from line no 1463. It checks for the condition Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Ah indeed! Maybe use ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I can do this. Or the current code is also fine. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @asottile This change looks good. No need for | ||
| if len(option_string) > 1 and option_string[1] in self.prefix_chars: | ||
| long_option_strings.append(option_string) | ||
| # infer destination, '--foo-bar' -> 'foo_bar' and '-x' -> 'x' | ||
| dest = kwargs.pop('dest', None) | ||