Closed
Description
Currently ClassVar
isn't implemented. I have opened python/typeshed#888 and submitted python/typeshed#889 (I hope it's enough). Once it's get merged mypy should implement this.
I would like to tackle this. I have started implementing this with ClassVar
definition from PR I had submitted to typeshed and so far mypy is able to treat ClassVar[T]
as T
, which is expected. Of course assignment semantics are main purpose of ClassVar
and I plan to implement them.
By the way, should mypy treat objects of this type as immutable, that is report errors on operations like calling append
on List
? AFAIK mypy doesn't have any concept of mutability.