Py
PyAttr dataclass
PyAttr(data: T, pytype: TypeAttribute | None = None)
Bases: Data[T]
Python attribute for compile-time values. This is a generic attribute that holds a Python value.
The constructor takes a Python value and an optional type attribute. If the type attribute is not provided, the type of the value is inferred as PyClass(type(value)).
Pretty Printing
This object is pretty printable via .print() method.
Source code in src/kirin/ir/attrs/py.py
39 40 41 42 43 44 45 | |
name class-attribute instance-attribute
name = 'PyAttr'
Name of the attribute in printing and other text format.
unwrap
unwrap() -> T
Returns the underlying data value.
Source code in src/kirin/ir/attrs/py.py
62 63 | |