Closed
Description
It seems that the re.compile
types are to restrictive, the following code errors in mypy but running it is no problem:
# _txt_fmt is a object gotten from `re.compile`
with open(file, 'r+') as f:
with mmap.mmap(f.fileno(), 0) as data:
match = _txt_fmt.match(data)
Mypy gives the error Argument 1 to "match" of "Pattern" has incompatible type "mmap"; expected "bytes"
.