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
6 7 8 9 10 11 12 13 14 15 16 17 | |
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.
Source code in xdsl/utils/classvar.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |