]> granicus.if.org Git - python/commit
Trivial dataclass cleanups: (GH-6218)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 24 Mar 2018 21:42:28 +0000 (14:42 -0700)
committerGitHub <noreply@github.com>
Sat, 24 Mar 2018 21:42:28 +0000 (14:42 -0700)
commit02c19a6fc08dd37a3a89cf1b9800c869c338bd3c
tree58b1999801429aae6b81390117e38336957f8443
parent471364b4d977fc31bdf3012912954f24e4867d52
Trivial dataclass cleanups: (GH-6218)

- 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 f96ddade0094d162cb6c2fd7255c5e8a90b5c37d)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
Lib/dataclasses.py