module documentation

Undocumented

Class Type Internal implementation of libstatic.Type.
Class TypeVariable No summary
Function AnnotationType Create a Type from it's qualified name.
Function BuiltinType Undocumented
Function cleanup_unresolved_typevars Undocumented
Function ClsType Create a Type from a classdef.
Function find_typedef Get the definition of the object qualified by the given name, type hint and location or raise an exception.
Function MembersTypes Get a lazy mapping of all types of the members of this class, including inherited.
Function SimpleType Create a Type that is not in the system.
Function SuperTypes Fetch the super-types in mro order of this classdef.
Function SymbolType Create a Type that is defined in the system but that's not a classdef.
Class _AnnotationStringParser When given an expression, the node returned by L{ast.NodeVisitor.visit()} will also be an expression. If any string literal contained in the original expression is either invalid Python or not a singular expression, L{SyntaxError} is raised.
Class _AnnotationToType Converts an annotation into a L{Type}.
Class _TypeInference Find the L{Type} of an expression.
Class _TypeVariableMeta Undocumented
Function _merge_types Undocumented
Function _raise Undocumented
Function _union Undocumented
Type Variable _T Undocumented
def AnnotationType(state: State, qualname: str) -> Type: (source)

Create a Type from it's qualified name.

Raises
StaticExceptionIf the name is not in the system and the qualname does not refer to a builtin or a typing name. In these cases, a type with no definition is returned because we can still account for it even if the modules 'typing' or 'buitlins' are not in the system.
def BuiltinType(state: State, name: str) -> Type: (source)

Undocumented

@overload
def cleanup_unresolved_typevars(term: None):
@overload
def cleanup_unresolved_typevars(term: Type) -> Type:
(source)

Undocumented

def ClsType(state: State, definition: Cls) -> Type: (source)

Create a Type from a classdef.

@lru_cache(maxsize=None)
def find_typedef(state: State, qualname: str, *, hint: type[Def] | tuple[type[Def], ...] = Def, location: NodeLocation | None = None) -> NameDef: (source)

Get the definition of the object qualified by the given name, type hint and location or raise an exception.

Wrapper arround get_defs_from_qualname.

def MembersTypes(state: State, definition: Cls) -> Mapping[str, Type]: (source)

Get a lazy mapping of all types of the members of this class, including inherited.

def SimpleType(qualname: str) -> Type: (source)

Create a Type that is not in the system.

def SuperTypes(state: State, definition: Cls) -> Sequence[Type]: (source)

Fetch the super-types in mro order of this classdef.

def SymbolType(state: State, definition: NameDef) -> Type: (source)

Create a Type that is defined in the system but that's not a classdef.

def _merge_types(state: State, defs: Sequence[NameDef | None]) -> Type: (source)

Undocumented

Undocumented

def _union(*args: Type | str) -> Type: (source)

Undocumented

Undocumented

Value
TypeVar('_T')