We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
urllib.request.urlopen
1 parent bbbf753 commit 2618e15Copy full SHA for 2618e15
stdlib/urllib/request.pyi
@@ -49,7 +49,14 @@ if sys.version_info < (3, 14):
49
__all__ += ["URLopener", "FancyURLopener"]
50
51
_T = TypeVar("_T")
52
+
53
+# The actual type is `addinfourl | HTTPResponse`, but users would need to use `typing.cast` or `isinstance` to narrow the type,
54
+# so we use `Any` instead.
55
+# See
56
+# - https://github.com/python/typeshed/pull/15042
57
+# - https://github.com/python/typing/issues/566
58
_UrlopenRet: TypeAlias = Any
59
60
_DataType: TypeAlias = ReadableBuffer | SupportsRead[bytes] | Iterable[bytes] | None
61
62
if sys.version_info >= (3, 13):
0 commit comments