API reference
python:astx:astx.literals.base.Literal
class Literal
Literal(*args: Any, **kwargs: Any)
Source: packages/astx/src/astx/literals/base.py:23
Literal Data type.
Attributes
-
ref — Identifier associated with this node.; Type: str
-
type_ — Type associated with this expression.; Type: ExprType
-
loc — Source coordinates attached to this node.; Type: SourceLocation
-
value — Stored value.; Type: Any
-
kind — Type: ASTKind
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
nbytes — Type: int
-
name — Type: str
-
_tmp_id — Type: int
Methods
-
__init__ — Initialize the literal base node.
-
__str__ — Return a string that represents the object.
-
get_struct — Return the AST representation for the object.