Skip to content

Commit 008f9eb

Browse files
authored
[http.cookie] Deprecate {Morsel,BaseCookie}.js_output methods (#16286)
1 parent 2b870ef commit 008f9eb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

stdlib/http/cookies.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ from _typeshed import MaybeNone, SupportsItems, SupportsKeysAndGetItem
22
from collections.abc import Container, Iterable
33
from types import GenericAlias
44
from typing import Any, Generic, TypeVar, overload
5+
from typing_extensions import deprecated
56

67
__all__ = ["CookieError", "BaseCookie", "SimpleCookie"]
78

@@ -34,6 +35,7 @@ class Morsel(dict[str, Any], Generic[_T]):
3435
def isReservedKey(self, K: str) -> bool: ...
3536
def output(self, attrs: Container[str] | None = None, header: str = "Set-Cookie:") -> str: ...
3637
__str__ = output
38+
@deprecated("Deprecated; will be removed in Python 3.19. Use `output()` instead.")
3739
def js_output(self, attrs: Container[str] | None = None) -> str: ...
3840
def OutputString(self, attrs: Container[str] | None = None) -> str: ...
3941
def __eq__(self, morsel: object) -> bool: ...
@@ -46,6 +48,7 @@ class BaseCookie(dict[str, Morsel[_T]], Generic[_T]):
4648
def value_encode(self, val: _T) -> tuple[str, str]: ...
4749
def output(self, attrs: Container[str] | None = None, header: str = "Set-Cookie:", sep: str = "\r\n") -> str: ...
4850
__str__ = output
51+
@deprecated("Deprecated; will be removed in Python 3.19. Use `output()` instead.")
4952
def js_output(self, attrs: Container[str] | None = None) -> str: ...
5053
def load(self, rawdata: str | SupportsItems[str, str | Morsel[Any]]) -> None: ...
5154
def __setitem__(self, key: str, value: str | Morsel[_T]) -> None: ...

0 commit comments

Comments
 (0)