]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-97799: use inspect.get_annotations in dataclass (#97800)
authorlarryhastings <larry@hastings.org>
Mon, 3 Oct 2022 22:46:09 +0000 (15:46 -0700)
committerGitHub <noreply@github.com>
Mon, 3 Oct 2022 22:46:09 +0000 (15:46 -0700)
commit00b5a08c807ebebf4180c06aac0c9b5c7d6c547f
tree46dad42c60120b6c2a234cd6383a23dddf7a0222
parentd78aa4e11a80653588229cc97119afae693d1c06
gh-97799: use inspect.get_annotations in dataclass (#97800)

dataclass used to get the annotations on a class object using
cls.__dict__.get('__annotations__').  Now that it always imports
inspect, it can use inspect.get_annotations, which is modern
best practice for coping with annotations.
Lib/dataclasses.py
Misc/NEWS.d/next/Library/2022-10-03-14-42-13.gh-issue-97799.Y1iJvf.rst [new file with mode: 0644]