summaryrefslogtreecommitdiff
path: root/Python/traceback.c
diff options
context:
space:
mode:
authorEric V. Smith <ericvsmith@users.noreply.github.com>2021-12-11 16:12:17 -0500
committerGitHub <noreply@github.com>2021-12-11 16:12:17 -0500
commite029c53e1a408b89a4e3edf30a9b38b094f9c880 (patch)
treea439835a4dd477b67b500e5d09ff82b739973791 /Python/traceback.c
parentbfc59ed0a00106f5ba4a32a0c5b3dbe71d12665d (diff)
downloadcpython-git-e029c53e1a408b89a4e3edf30a9b38b094f9c880.tar.gz
bpo-44674: Use unhashability as a proxy for mutability for default dataclass __init__ arguments. (GH-29867)
`@dataclass` in 3.10 prohibits using list, dict, or set as default values. It does this to avoid the mutable default problem. This test is both too strict, and not strict enough. Too strict, because some immutable subclasses should be safe, and not strict enough, because other mutable types should be prohibited. With this change applied, `@dataclass` now uses unhashability as a proxy for mutability: if objects aren't hashable, they're assumed to be mutable.
Diffstat (limited to 'Python/traceback.c')
0 files changed, 0 insertions, 0 deletions