Module bare.util
Classes
class Field (ty: Type[BAREType | Enum],
attr: str | None = None)-
Expand source code
def __get__(self, inst, _) -> T | Type[BAREType[T] | Enum]: if inst is None: return self.ty return inst.__dict__[self.attr]A descriptor that assists with assigning/retrieving values from a BARE Struct. It is reponsible for performing type validation on assignment of struct fields.
For example:
class MyStruct(Struct): a = Field(UInt) b = Field(Str)Class variables
var attr : strvar name : strvar ty : Type[BAREType | Enum]