given the following class:
from typing import AnyStr
class A(object):
def __init__(self, param):
# type: (AnyStr) -> None
self.a = param # type: AnyStr
I get the following output:
$ mypy . -v
LOG: Mypy version 0.521
LOG: Build finished in 1.199 seconds with 10 modules, 2076 types, and 2 errors
test.py:8: error: Incompatible types in assignment (expression has type "str", variable has type "AnyStr")
test.py:8: error: Incompatible types in assignment (expression has type "bytes", variable has type "AnyStr"
How come this assign operation gives incompatible type?