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

annotationlib.type_repr

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


Import

import annotationlib
from annotationlib import type_repr

Signature & Overview

annotationlib.type_repr(value)

Convert a Python value to a format suitable for use with the STRING format.

Usage

import annotationlib

assert annotationlib.type_repr(int) == "int"
assert annotationlib.type_repr(list[str]) == "list[str]"

Gotchas

REPL Inspect

from annotationlib import type_repr
help(type_repr)

Linked from

Related notes