Skip to content

Trivial dataclass cleanups:#6218

Merged
ericvsmith merged 1 commit into
python:masterfrom
ericvsmith:dataclass-whitespace-and-comments
Mar 24, 2018
Merged

Trivial dataclass cleanups:#6218
ericvsmith merged 1 commit into
python:masterfrom
ericvsmith:dataclass-whitespace-and-comments

Conversation

@ericvsmith

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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