On this page
  1. annotationlib.annotations_to_string
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

annotationlib.annotations_to_string

Up: annotationlib | Next: annotationlib.call_annotate_function
Rel: annotationlib.call_annotate_function, annotationlib.call_evaluate_function, annotationlib.Format, annotationlib.ForwardRef
Ref: docs.python.org — annotationlib.annotations_to_string
Tags: #public #python3 #stdlib #annotationlib


Import

import annotationlib
from annotationlib import annotations_to_string

Signature & Overview

annotationlib.annotations_to_string(annotations)

Convert an annotation dict containing values to approximately the STRING format.

Usage

import annotationlib

out = annotationlib.annotations_to_string({"x": int, "return": str})
assert out == {"x": "int", "return": "str"}

Gotchas

REPL Inspect

from annotationlib import annotations_to_string
help(annotations_to_string)

Linked from

Related notes