We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've got this MRE:
import logging stream_handler = logging.StreamHandler() file_handler = logging.FileHandler('output.txt') logger = logging.getLogger() for handler in (stream_handler, file_handler): logger.addHandler(handler)
mypy 0.942 with Python 3.9.5 complains
error: Argument 1 to "addHandler" of "Logger" has incompatible type "object": expected "Handler"
reveal_type says that stream_handler is a logging.StreamHandler[typing.TextIO] whereas file_handler is a logging.FileHandler.
reveal_type
stream_handler
logging.StreamHandler[typing.TextIO]
file_handler
logging.FileHandler
The error doesn't appear with mypy 0.910.
The text was updated successfully, but these errors were encountered:
Fixed in #17408, which was released with v1.11.0
Sorry, something went wrong.
No branches or pull requests
I've got this MRE:
mypy 0.942 with Python 3.9.5 complains
reveal_type
says thatstream_handler
is alogging.StreamHandler[typing.TextIO]
whereasfile_handler
is alogging.FileHandler
.The error doesn't appear with mypy 0.910.
The text was updated successfully, but these errors were encountered: