API reference
python:astx:astx.literals.LiteralComplex
class LiteralComplex
LiteralComplex(real: float, imag: float, loc: SourceLocation = NO_SOURCE_LOCATION)
Source: packages/astx/src/astx/literals/numeric.py:442
Declared as: python:astx:astx.literals.numeric.LiteralComplex
Base class for literal complex numbers.
Attributes
-
type_ — Type associated with this expression.; Type: Complex
-
value — Stored value.; Type: tuple[float, float]
-
loc — Type: SourceLocation
-
kind — Type: ASTKind
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
-
nbytes — Type: int
-
name — Type: str
-
_tmp_id — Type: int
Methods
-
__init__ — Initialize a generic complex number.
-
__str__ — Return a string that represents the object.
-
get_struct — Return the AST representation for the complex literal.