Lines Matching refs:ClassVar
221 # String regex that string annotations for ClassVar or InitVar must match.
648 # test if this is a ClassVar.
649 return (a_type is typing.ClassVar
651 and a_type.__origin__ is typing.ClassVar))
667 # ClassVar, then a_module is typing, and a_type is
668 # typing.ClassVar.
685 # With string annotations, cv0 will be detected as a ClassVar:
686 # CV = ClassVar
691 # But in this example cv1 will not be detected as a ClassVar:
694 # CV = ClassVar
699 # ClassVar. This is a fairly obscure corner case, and the best
745 # going to decide if it's a ClassVar or InitVar, everything else
753 # annotation. So, make a best effort to see if this is a ClassVar
760 # annotation to be a ClassVar. So, only look for ClassVar if
767 and _is_type(f.type, cls, typing, typing.ClassVar,
787 # Special restrictions for ClassVar and InitVar.
796 # ClassVar and InitVar to specify init=<anything>.
808 raise TypeError(f'field {f.name} is a ClassVar but specifies '