Closed
Description
There seems to be inconsistent behavior between these two equivalent pieces of code.
mypy is happy with this:
import http.client
errors = {'not_found': http.client.NOT_FOUND} # type: ignore
but this fails with "module" has no attribute "NOT_FOUND"
(no matter where I put the annotation):
import http.client
errors = { # type: ignore
'not_found': http.client.NOT_FOUND # type: ignore
} # type: ignore