Conversation
Annotating the type of this as `None` like is currently done causes mypy to generate an error, like this: ``` hash.py:2: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[object], int]") ``` python/mypy#4266 Annotating this as `ClassVar[None]` seems to work. My other attempt of annotating as e.g. `Optional[Callable]` doesn't
auscompgeek
left a comment
There was a problem hiding this comment.
This follows the convention used by typeshed to mark a class as unhashable. e.g. array.array
|
Agree - however, note the |
|
According to this mypy issue (python/mypy#4266) mypy is automatically treating types with |
Annotating the type of this as
Nonelike is currently done causes mypy to generate an error, like this:python/mypy#4266
Annotating this as
ClassVar[Any]seems to work. My other attempt of annotating as e.g.Optional[Callable]doesn't