]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Small speedup for dataclass __eq__ and __repr__ (#104904)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Tue, 30 May 2023 16:35:30 +0000 (11:35 -0500)
committerGitHub <noreply@github.com>
Tue, 30 May 2023 16:35:30 +0000 (12:35 -0400)
commit18cfc1eea569f0ce72ad403840c0e6cc5f81e1c2
tree6c22d1e19cd837879770365203b29e1c8a63ed76
parentc8c1e73d95d5dcd7a2c8d7c10cfafc3fe5a9377e
Small speedup for dataclass __eq__ and __repr__ (#104904)

Faster __repr__ with str.__add__ moved inside the f-string. For __eq__ comp;are field by field instead of building temporary tuples.

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Lib/dataclasses.py