Lines Matching full:annotations
4 Annotations Best Practices
12 for working with annotations dicts. If you write Python code
17 best practices for accessing the annotations of an object
19 best practices for accessing the annotations of an object
27 ``__annotations__``, not uses *for* annotations.
32 Accessing The Annotations Dict Of An Object In Python 3.10 And Newer
38 accessing the annotations dict of any object that supports
39 annotations. This function can also "un-stringize"
40 stringized annotations for you.
50 to get at the object's annotations dict.
61 defines no annotations but that has a parent class with
62 annotations would return the parent's ``__annotations__``.
63 In Python 3.10 and newer, the child class's annotations
67 Accessing The Annotations Dict Of An Object In Python 3.9 And Older
70 In Python 3.9 and older, accessing the annotations dict
73 specifically to do with class annotations.
75 Best practice for accessing the annotations dict of other
86 inadvertently return the annotations dict of a *base class.*
98 This will print the annotations dict from ``Base``, not
104 of Python 3.9 and before: if a class has annotations defined,
106 the class may or may not have annotations defined, best practice
128 Manually Un-Stringizing Stringized Annotations
131 In situations where some annotations may be "stringized",
158 However, not all string values used as annotations can
172 API that works with annotations, it's recommended to only
200 objects lazy-create an annotations dict if no annotations
204 that it will store and return as its annotations. Deleting the
205 annotations on a function before it has lazily created its annotations
214 accessing the annotations on that object using ``fn.__annotations__``
220 If Python stringizes your annotations for you
221 (using ``from __future__ import annotations``), and you
226 from __future__ import annotations