On this page
  1. typing.ForwardRef
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

typing.ForwardRef

Prev: typing.final | Up: typing | Next: typing.FrozenSet
Rel: typing.AbstractSet, typing.Annotated, typing.Any, typing.assert_never
Ref: docs.python.org — typing.ForwardRef
Tags: #public #python3 #stdlib #typing


Import

import typing
from typing import ForwardRef

Signature & Overview

typing.ForwardRef(arg, *, module=None, owner=None, is_argument=True, is_class=False)

Wrapper that holds a forward reference.

Methods & Attributes

Usage

from typing import ForwardRef

ref = ForwardRef("Node")
assert ref.__forward_arg__ == "Node"

Gotchas

REPL Inspect

from typing import ForwardRef
help(ForwardRef)

Linked from

Related notes