• Home
  • Raw
  • Download

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 Accessing The Annotations Dict Of An Object In Python 3.9 And Older
64 In Python 3.9 and older, accessing the annotations dict
67 specifically to do with class annotations.
69 Best practice for accessing the annotations dict of other
80 inadvertently return the annotations dict of a *base class.*
92 This will print the annotations dict from ``Base``, not
98 of Python 3.9 and before: if a class has annotations defined,
100 the class may or may not have annotations defined, best practice
122 Manually Un-Stringizing Stringized Annotations
125 In situations where some annotations may be "stringized",
152 However, not all string values used as annotations can
166 API that works with annotations, it's recommended to only
194 objects lazy-create an annotations dict if no annotations
198 that it will store and return as its annotations. Deleting the
199 annotations on a function before it has lazily created its annotations
208 accessing the annotations on that object using ``fn.__annotations__``
214 If Python stringizes your annotations for you
215 (using ``from __future__ import annotations``), and you
220 from __future__ import annotations