You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[copied from other issue] Meanwhile, upon checking the Python documentation, it turns out that only when subscribed by typing.ClassVar is an annotate variable considered a class variable. Copied from the above-mentioned documentation:
What I had as an example in the original post is therefore an instance variable, not a class variable. This contradicts the discussion in PyCQA/flake8-bugbear#293, which only has to do with typing.ClassVar.
The text was updated successfully, but these errors were encountered:
fromabcimportABCclassFoo(ABC):
a: ClassVar[int] #<--- should not trigger B024classBar(ABC):
b: int#<--- should trigger B024 because it is not annotated as a class variable
this makes some sense to me but I'd have to read the documentation to make sure I'm understanding correctly, so I'm not sure whether to adopt this behavior just yet.
This issue derives from #14455 (comment).
[copied from other issue] Meanwhile, upon checking the Python documentation, it turns out that only when subscribed by typing.ClassVar is an annotate variable considered a class variable. Copied from the above-mentioned documentation:
What I had as an example in the original post is therefore an instance variable, not a class variable. This contradicts the discussion in PyCQA/flake8-bugbear#293, which only has to do with typing.ClassVar.
The text was updated successfully, but these errors were encountered: