Classvar
classvar
¶
is_classvar(annotation: Any) -> bool
¶
The type annotation can be one of
* ClassVar[MyType],
* ClassVar, or
* "ClassVar[MyType]".
Source code in xdsl/utils/classvar.py
is_const_classvar(field_name: str, annotation: Any, error_type: type[PyRDLError]) -> bool
¶
Operation definitions may only have *_def fields or constant class variables,
where the constness is defined by convention with an UPPER_CASE name and enforced by
pyright.
The type annotation can be one of
* ClassVar[MyType],
* ClassVar, or
* "ClassVar[MyType]".
This function throws an exception on a non UPPER_CASE class variable.