Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ClassVar implementation #2771

Closed
Closed
@miedzinski

Description

@miedzinski

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions