Commit graph

2 commits

Author SHA1 Message Date
Nikita Sobolev
0102faf0ca
[3.12] gh-108303: Move all inspect test files to test_inspect/ (GH-109607) (#110732)
(cherry picked from commit 732532b0af)
2023-10-13 19:05:03 +02:00
larryhastings
74613a46fc
bpo-43817: Add inspect.get_annotations(). (#25522)
Add inspect.get_annotations, which safely computes the annotations defined on an object.  It works around the quirks of accessing the annotations from various types of objects, and makes very few assumptions about the object passed in. inspect.get_annotations can also correctly un-stringize stringized annotations.

inspect.signature, inspect.from_callable, and inspect.from_function now call inspect.get_annotations to retrieve annotations.  This means inspect.signature and inspect.from_callable can now un-stringize stringized annotations, too.
2021-04-29 21:16:28 -07:00