[http.cookies] 'value', 'coded_value', and 'key' of Morsel can return None (#15264)

This commit is contained in:
b9788213
2026-01-12 18:56:26 +03:00
committed by GitHub
parent 6fa275f4a7
commit ce2b37da45
+4 -3
View File
@@ -1,3 +1,4 @@
from _typeshed import MaybeNone
from collections.abc import Iterable, Mapping
from types import GenericAlias
from typing import Any, Generic, TypeVar, overload
@@ -21,11 +22,11 @@ class CookieError(Exception): ...
class Morsel(dict[str, Any], Generic[_T]):
@property
def value(self) -> str: ...
def value(self) -> str | MaybeNone: ...
@property
def coded_value(self) -> _T: ...
def coded_value(self) -> _T | MaybeNone: ...
@property
def key(self) -> str: ...
def key(self) -> str | MaybeNone: ...
def __init__(self) -> None: ...
def set(self, key: str, val: str, coded_val: _T) -> None: ...
def setdefault(self, key: str, val: str | None = None) -> str: ...