pg.typing.ForwardRef

Accessible via pg.typing.ForwardRef.

class ForwardRef(module, name)[source]

Bases: pg.Formattable

Forward type reference.

Methods:

as_annotation()

Returns the forward reference as an annotation.

format(*args[, markdown])

Format this object.

Attributes:

cls

Returns the resolved reference class..

module

Returns the module where the name is being referenced.

name

Returns the name of the type reference.

qualname

Returns the qualified name of the reference.

resolved

Returns True if the symbol for the name is resolved..

as_annotation()[source]

Returns the forward reference as an annotation.

Return type:

Union[Type[Any], str]

property cls: Type[Any][source]

Returns the resolved reference class..

format(*args, markdown=False, **kwargs)[source]

Format this object.

Return type:

str

property module: ModuleType[source]

Returns the module where the name is being referenced.

property name: str[source]

Returns the name of the type reference.

property qualname: str[source]

Returns the qualified name of the reference.

property resolved: bool[source]

Returns True if the symbol for the name is resolved..