astx.types.generic

astx.types.generic

Source: packages/astx/src/astx/types/generic.py

title: ASTx AST type helpers.
summary: >-
  Provide semantic-facing type nodes that extend the upstream ASTx type model
  without coupling them to template metadata helpers.

Classes

UnionType(AnyType)

title: Finite compile-time union type domain.
summary: >-
  Represent one union of concrete type references that semantic analysis
  may enumerate as a finite type domain.
attributes:
  members:
    type: tuple[astx.DataType, Ellipsis]
  alias_name:
    type: str | None

Methods

get_struct(self, simplified: bool=False) -> astx.base.ReprStruct
title: Build one repr structure for a finite union type.
parameters:
  simplified:
    type: bool
returns:
  type: astx.base.ReprStruct

TemplateTypeVar(AnyType)

title: Semantic-only template type variable.
summary: >-
  Represent one unresolved template type parameter inside function
  signatures or local declared types before specialization.
attributes:
  name:
    type: str
  bound:
    type: astx.DataType

Methods

get_struct(self, simplified: bool=False) -> astx.base.ReprStruct
title: Build one repr structure for a template type variable.
parameters:
  simplified:
    type: bool
returns:
  type: astx.base.ReprStruct

GeneratorType(AnyType)

title: First-class generator object type.
summary: >-
  Represent one stateful generator value that yields values of one
  statically known element type when iterated.
attributes:
  yield_type:
    type: astx.DataType

Methods

get_struct(self, simplified: bool=False) -> astx.base.ReprStruct
title: Build one repr structure for a generator type.
parameters:
  simplified:
    type: bool
returns:
  type: astx.base.ReprStruct