You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mypy guesses that this type is BinaryIO, but that it does not have the peek() method. That type is correct with regard to the abstract types of things open() can return, but in this case it's an _io.BufferedReader, which does have peek().
The text was updated successfully, but these errors were encountered:
I came across #2166, but this looks more like stub definition problems. This case appears to be that peek is really only applicable to a very specific subclass that open() can return to which BinaryIO is not meant to apply, necessarily.
mypy --strict
.Mypy version: 0.670
I've got a snippet like this:
mypy guesses that this type is BinaryIO, but that it does not have the peek() method. That type is correct with regard to the abstract types of things open() can return, but in this case it's an
_io.BufferedReader
, which does havepeek()
.The text was updated successfully, but these errors were encountered: