diff options
author | larryhastings <larry@hastings.org> | 2022-10-03 22:46:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-03 22:46:09 (GMT) |
commit | 00b5a08c807ebebf4180c06aac0c9b5c7d6c547f (patch) | |
tree | 46dad42c60120b6c2a234cd6383a23dddf7a0222 /Misc/NEWS.d/next | |
parent | d78aa4e11a80653588229cc97119afae693d1c06 (diff) | |
download | cpython-00b5a08c807ebebf4180c06aac0c9b5c7d6c547f.zip cpython-00b5a08c807ebebf4180c06aac0c9b5c7d6c547f.tar.gz cpython-00b5a08c807ebebf4180c06aac0c9b5c7d6c547f.tar.bz2 |
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.
Diffstat (limited to 'Misc/NEWS.d/next')
-rw-r--r-- | Misc/NEWS.d/next/Library/2022-10-03-14-42-13.gh-issue-97799.Y1iJvf.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2022-10-03-14-42-13.gh-issue-97799.Y1iJvf.rst b/Misc/NEWS.d/next/Library/2022-10-03-14-42-13.gh-issue-97799.Y1iJvf.rst new file mode 100644 index 0000000..71097d2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-10-03-14-42-13.gh-issue-97799.Y1iJvf.rst @@ -0,0 +1,2 @@ +:mod:`dataclass` now uses :func:`inspect.get_annotations` to examine the +annotations on class objects. |