diff --git a/stdlib/urllib/response.pyi b/stdlib/urllib/response.pyi index 65df9cdff58f..459b9d1bbdda 100644 --- a/stdlib/urllib/response.pyi +++ b/stdlib/urllib/response.pyi @@ -4,6 +4,7 @@ from collections.abc import Callable, Iterable from email.message import Message from types import TracebackType from typing import IO, Any +from typing_extensions import deprecated __all__ = ["addbase", "addclosehook", "addinfo", "addinfourl"] @@ -32,9 +33,13 @@ class addinfo(addbase): class addinfourl(addinfo): url: str - code: int | None + code: int | None # Deprecated since Python 3.9. Use `addinfourl.status` attribute instead. @property def status(self) -> int | None: ... def __init__(self, fp: IO[bytes], headers: Message, url: str, code: int | None = None) -> None: ... + @deprecated("Deprecated since Python 3.9. Use `addinfourl.url` attribute instead.") def geturl(self) -> str: ... + @deprecated("Deprecated since Python 3.9. Use `addinfourl.headers` attribute instead.") + def info(self) -> Message: ... + @deprecated("Deprecated since Python 3.9. Use `addinfourl.status` attribute instead.") def getcode(self) -> int | None: ...