API reference
python:astx:astx.NamespaceType
class NamespaceType
NamespaceType(namespace_key: str, *, namespace_kind: NamespaceKind = NamespaceKind.MODULE, display_name: str | None = None)
Source: packages/astx/src/astx/modules.py:28
Declared as: python:astx:astx.modules.NamespaceType
Semantic-only namespace type.
Represent one imported namespace value during semantic analysis and lowering without modeling it as a user-defined runtime aggregate.
Attributes
-
namespace_key — Namespace key.; Type: str
-
namespace_kind — Namespace kind.; Type: NamespaceKind
-
display_name — Name of display.; Type: str | None
-
module_key — Canonical module identity.; Type: str
-
loc — Type: SourceLocation
-
kind — Type: ASTKind
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
-
nbytes — Type: int
-
type_ — Type: ExprType
-
name — Type: str
-
_tmp_id — Type: int
Methods
-
__init__ — Initialize one namespace type.
-
__str__ — Render one namespace type as text.
-
get_struct — Build one repr structure for a namespace type.
Properties
- module_key — Return the legacy module-key alias for this namespace.