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
Running ruff 0.0.282 using ruff --isolated --select=RUF012 on the following file:
fromtypingimportClassVarclassC:
f: ClassVar= {0}
gives
x.py:4:19: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
I think Ruff should not emit RUF012 for this, since if ClassVar is used without the [...] part, the type checkers infer the type, i.e. the [...] part is optional, similar to Final.
The text was updated successfully, but these errors were encountered:
bluetech
added a commit
to bluetech/ruff
that referenced
this issue
Aug 2, 2023
Running ruff
0.0.282
usingruff --isolated --select=RUF012
on the following file:gives
I think Ruff should not emit RUF012 for this, since if
ClassVar
is used without the[...]
part, the type checkers infer the type, i.e. the[...]
part is optional, similar toFinal
.The text was updated successfully, but these errors were encountered: