mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-06-23 17:28:38 +08:00
[stdlib] Add a comment to the alias for the return type of urllib.request.urlopen (#15042)
This commit is contained in:
committed by
GitHub
parent
bbbf7530a9
commit
2618e150d0
@@ -49,7 +49,14 @@ if sys.version_info < (3, 14):
|
||||
__all__ += ["URLopener", "FancyURLopener"]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
# The actual type is `addinfourl | HTTPResponse`, but users would need to use `typing.cast` or `isinstance` to narrow the type,
|
||||
# so we use `Any` instead.
|
||||
# See
|
||||
# - https://github.com/python/typeshed/pull/15042
|
||||
# - https://github.com/python/typing/issues/566
|
||||
_UrlopenRet: TypeAlias = Any
|
||||
|
||||
_DataType: TypeAlias = ReadableBuffer | SupportsRead[bytes] | Iterable[bytes] | None
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
|
||||
Reference in New Issue
Block a user