-
-
Notifications
You must be signed in to change notification settings - Fork 34k
bpo-30152: Reduce the number of imports for argparse. #1269
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
Changes from 1 commit
eccaf69
79b085f
30c87cd
46c77d3
d8a622c
dad5bae
578af90
48a2abf
502bf6a
c449538
025688d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -143,7 +143,7 @@ def _copy_items(items): | |
| if type(items) is list: | ||
| return items[:] | ||
|
Member
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. Why not items.copy()?
Member
Author
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. It is shorter.
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. And it's faster. |
||
| import copy | ||
| items = copy.copy(items) | ||
| return copy.copy(items) | ||
|
|
||
|
|
||
| # =============== | ||
|
|
||
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.
Why not isinstance(items, list)?
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.
listsubclass can override__copy__or__reduce__.