class C(metaclass=Classtools, slots=True): with OPTIONS(tag='test'): e: int with TAG('test'): d: attr = None with OPTIONS | tag('test'): c: tuple = (1, 2, 3) no_tag: attr = 1 with OPTIONS: b: int = -8 | tag('test') a: int = Attr(-8, tag='test')
class H(metaclass=Classtools, slots=True): none = 'conventional class variable' a: Any = ... b: attr = ... | kw e: ClassVar[str] = Attr('e_classvar', kw=False) f: int = 1 / kw | skip with OPTIONS(kw=True): g: attr = 8 h: bool = True / kw k: Any = Attr('replace', tag='tag_h') m: attr = () | tag('tag_m') | lazy('get_m') | const | skip n: ClassVar[Union[str, int]] = 'n_classvar' def get_m(self): return 'm_value'
class K(metaclass=Classtools, slots=True): none = 'conventional class variable' a: Any = ... b: attr = ... | skip p: attr = ... | const j: attr = ... | lazy('get_j') c: attr = [1, 2, 3] d: ClassVar[str] = Attr({1: 'a'}) e: int = 'will be replaced with []' f: attr = ClassCopy() g: attr = ClassNoCopy() h: Any = Attr('replace', tag='tag_h') m: attr = {} | tag('max options') | lazy('get_m') | const | kw n: ClassVar[list] = [] def get_m(self): return ['m_value'] def get_j(self): return ['j_value']
class M(metaclass=Classtools, slots=True, init=False): none = 'conventional class variable' a: Any = ... b: attr = ... | skip p: attr = ... | const j: attr = ... | lazy('get_j') c: attr = [1, 2, 3] d: ClassVar[str] = {1: 'a'} e: str = 'e' f: attr = Attr() | kw g: attr = 'g' | kw h: Any = Attr(42, tag='tag_h') m: attr = {} | tag('max options') | lazy('get_m') | const | kw n: ClassVar[list] = [] def get_m(self): return 'm_value' def get_j(self): return 'j_value'
class G(metaclass=Classtools, slots=True): none = 'conventional class variable' a: Any = ... b: attr = ... | tag(object) | skip k: attr = ... | tag('tag_k') | const c: attr = 1 | tag('tag_c') d: ClassVar[str] = Attr('b', tag=None) e: int = 1 | tag('tag_e') | skip with TAG('tag_section'): f: attr = 8 g: bool = True / tag h: Any = Attr('replace', tag='tag_h') m: attr = () | tag('tag_m') | lazy('get_m') | const | skip n: ClassVar[tuple] = () / tag('dont_care') def get_m(self): return 'm_value'