bundles / IPython latest / IPython / core / guarded_eval / _collect_annotations
function
IPython.core.guarded_eval:_collect_annotations
Signature
def _collect_annotations(cls: type) → dictSummary
Collect annotations of a class and its bases without resolving them.
Extended Summary
typing.get_type_hints() is not usable here because it resolves stringized annotations with eval(); under PEP 563 every annotation of a module is a string, so that would run arbitrary code from __annotations__. Strings are left as-is and later resolved by _eval_annotation under the policy.
Aliases
IPython.core.guarded_eval._collect_annotations