Skip to content
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

Trivial dataclass cleanups: #6218

Merged

Conversation

ericvsmith
Copy link
Member

  • When adding a single element to a list, use .append() instead of
    += and creating a new list.
  • For consistency, import the copy module, instead of just deepcopy. This
    leaves only a module at the class level, instead of a function.
  • Improve some comments.
  • Improve some whitespace.
  • Use tuples instead of lists.
  • Simplify a truth test.

- When adding a single element to a list, use .append() instead of
  += and creating a new list.
- For consistency, import the copy module, instead of just deepcopy. This
  leaves only a module at the class level, instead of a function.
- Improve some comments.
- Improve some whitespace.
- Use tuples instead of lists.
- Simplify a test.
@miss-islington
Copy link
Contributor

Thanks @ericvsmith for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@ericvsmith ericvsmith deleted the dataclass-whitespace-and-comments branch March 24, 2018 21:20
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 24, 2018
- When adding a single element to a list, use .append() instead of
  += and creating a new list.
- For consistency, import the copy module, instead of just deepcopy. This
  leaves only a module at the class level, instead of a function.
- Improve some comments.
- Improve some whitespace.
- Use tuples instead of lists.
- Simplify a test.
(cherry picked from commit f96ddad)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
@bedevere-bot
Copy link

GH-6219 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this pull request Mar 24, 2018
- When adding a single element to a list, use .append() instead of
  += and creating a new list.
- For consistency, import the copy module, instead of just deepcopy. This
  leaves only a module at the class level, instead of a function.
- Improve some comments.
- Improve some whitespace.
- Use tuples instead of lists.
- Simplify a test.
(cherry picked from commit f96ddad)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants