Skip to content

Commit 2a19acd

Browse files
committed
Added SimpleCookie.value_encode/value_decode docs
1 parent eb0d5c3 commit 2a19acd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Lib/http/cookies.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,16 @@ class SimpleCookie(BaseCookie):
605605
received from HTTP are kept as strings.
606606
"""
607607
def value_decode(self, val):
608+
"""
609+
Return an unquoted string, from the cookie header in a reversed fasion of value_encode.
610+
"""
611+
608612
return _unquote(val), val
609613

610614
def value_encode(self, val):
615+
"""
616+
Return an escaped quoted string, if needed, for the cookie header usage.
617+
Will include non-compliant characters in the cookie value if exist.
618+
"""
611619
strval = str(val)
612620
return strval, _quote(strval)

0 commit comments

Comments
 (0)