]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-32513: Make it easier to override dunders in dataclasses. (GH-5366)
authorEric V. Smith <ericvsmith@users.noreply.github.com>
Sun, 28 Jan 2018 00:07:40 +0000 (19:07 -0500)
committerGitHub <noreply@github.com>
Sun, 28 Jan 2018 00:07:40 +0000 (19:07 -0500)
commitea8fc52e75363276db23c6a8d7a689f79efce4f9
treeca662ba631df1f6e6e32b5b0d95a6b5458d5699c
parent2a2247ce5e1984eb2f2c41b269b38dbb795a60cf
bpo-32513: Make it easier to override dunders in dataclasses. (GH-5366)

Class authors no longer need to specify repr=False if they want to provide a custom __repr__ for dataclasses. The same thing applies for the other dunder methods that the dataclass decorator adds. If dataclass finds that a dunder methods is defined in the class, it will not overwrite it.
Lib/dataclasses.py
Lib/test/test_dataclasses.py
Misc/NEWS.d/next/Library/2018-01-27-11-20-16.bpo-32513.ak-iD2.rst [new file with mode: 0644]