typing.evaluate_forward_ref
Prev: typing.Dict | Up: typing | Next: typing.Final
Rel: typing.AbstractSet, typing.Annotated, typing.Any, typing.assert_never
Ref: docs.python.org — typing.evaluate_forward_ref
Tags: #public #python3 #stdlib #typing
Import
import typing
from typing import evaluate_forward_ref
Signature & Overview
typing.evaluate_forward_ref(forward_ref, *, owner=None, globals=None, locals=None, type_params=None, format=None, _recursive_guard=frozenset())
Evaluate a forward reference as a type hint.
Usage
from typing import ForwardRef, evaluate_forward_ref
ref = ForwardRef("int")
assert evaluate_forward_ref(ref) is int
Gotchas
- Requires Python 3.14+: Evaluates a
ForwardRefcleanly using PEP 649 /annotationlibsemantics.
REPL Inspect
from typing import evaluate_forward_ref
help(evaluate_forward_ref)
Linked from
Related notes
- tuts/python3/stdlib_module/typing/Dict Linked here; links to this page; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/Final Linked here; links to this page; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/typing/AbstractSet Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/Annotated Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/Any Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/assert_never Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/assert_type shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/AsyncContextManager shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/AsyncGenerator shared tags: #stdlib, #typing