You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a bit confused as to why http.cookies.SimpleCookie is declared as a generic class and not like below?
classSimpleCookie(BaseCookie[str]):
...
The documentation on SimpleCookie only talks about strings:
class http.cookies.SimpleCookie([input])¶
This class derives from BaseCookie and overrides value_decode() and value_encode(). SimpleCookie supports strings as cookie values. When setting the value, SimpleCookie calls the builtin str() to convert the value to a string. Values received from HTTP are kept as strings.
And from what I'm seeing, implementations value_decode and value_encode for SimpleCookie only produces strings (but perhaps I'm missing something)?
I'm a bit confused as to why
http.cookies.SimpleCookie
is declared as a generic class and not like below?The documentation on
SimpleCookie
only talks about strings:And from what I'm seeing, implementations
value_decode
andvalue_encode
forSimpleCookie
only produces strings (but perhaps I'm missing something)?Ref: https://github.com/python/cpython/blob/1ee50e2a78f644d81d341a08562073ad169d8cc7/Lib/http/cookies.py#L607-L612
The text was updated successfully, but these errors were encountered: