From 3532aec98a277da747a12c47e71478ce5be9c0ee Mon Sep 17 00:00:00 2001 From: donbarbos Date: Sat, 22 Aug 2026 14:28:33 +0400 Subject: [PATCH] [http.cookie] Deprecate {Morsel,BaseCookie}.js_output methods Morsel docs: https://docs.python.org/3.15/library/http.cookies.html#http.cookies.Morsel.js_output BaseCookie docs: https://docs.python.org/3.15/library/http.cookies.html#http.cookies.BaseCookie.js_output --- stdlib/http/cookies.pyi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stdlib/http/cookies.pyi b/stdlib/http/cookies.pyi index bdec1068b5ea..682884423448 100644 --- a/stdlib/http/cookies.pyi +++ b/stdlib/http/cookies.pyi @@ -2,6 +2,7 @@ from _typeshed import MaybeNone, SupportsItems, SupportsKeysAndGetItem from collections.abc import Container, Iterable from types import GenericAlias from typing import Any, Generic, TypeVar, overload +from typing_extensions import deprecated __all__ = ["CookieError", "BaseCookie", "SimpleCookie"] @@ -34,6 +35,7 @@ class Morsel(dict[str, Any], Generic[_T]): def isReservedKey(self, K: str) -> bool: ... def output(self, attrs: Container[str] | None = None, header: str = "Set-Cookie:") -> str: ... __str__ = output + @deprecated("Deprecated; will be removed in Python 3.19. Use `output()` instead.") def js_output(self, attrs: Container[str] | None = None) -> str: ... def OutputString(self, attrs: Container[str] | None = None) -> str: ... def __eq__(self, morsel: object) -> bool: ... @@ -46,6 +48,7 @@ class BaseCookie(dict[str, Morsel[_T]], Generic[_T]): def value_encode(self, val: _T) -> tuple[str, str]: ... def output(self, attrs: Container[str] | None = None, header: str = "Set-Cookie:", sep: str = "\r\n") -> str: ... __str__ = output + @deprecated("Deprecated; will be removed in Python 3.19. Use `output()` instead.") def js_output(self, attrs: Container[str] | None = None) -> str: ... def load(self, rawdata: str | SupportsItems[str, str | Morsel[Any]]) -> None: ... def __setitem__(self, key: str, value: str | Morsel[_T]) -> None: ...