Currently the headers field of urllib.response.addinfourl, which is also returned by the info() method, is annotated as having type Mapping[str, str]. However, in practice and in the documentation, it has the type email.message.Message. While that is a mapping, it has a lot of extra methods as well.
Note that headers and info() are actually defined on the addinfo base class of addinfourl, but addinfo is never instantiated itself except by the unit test.
Currently the
headersfield ofurllib.response.addinfourl, which is also returned by theinfo()method, is annotated as having typeMapping[str, str]. However, in practice and in the documentation, it has the typeemail.message.Message. While that is a mapping, it has a lot of extra methods as well.Note that
headersandinfo()are actually defined on theaddinfobase class ofaddinfourl, butaddinfois never instantiated itself except by the unit test.