summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-03-18 08:59:57 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-03-18 08:59:57 (GMT)
commit9c1a9b2657b5e39c6359698e160cb2b7e6df1193 (patch)
tree807b9bced4326cb4c4ab7c8b531ff06455b3a100 /Doc
parent3505bd82a9b6a06ca4d97b2386c8da167b387743 (diff)
downloadcpython-9c1a9b2657b5e39c6359698e160cb2b7e6df1193.zip
cpython-9c1a9b2657b5e39c6359698e160cb2b7e6df1193.tar.gz
cpython-9c1a9b2657b5e39c6359698e160cb2b7e6df1193.tar.bz2
Issue #2211: Updated the implementation of the http.cookies.Morsel class.
Setting attributes key, value and coded_value directly now is deprecated. update() and setdefault() now transform and check keys. Comparing for equality now takes into account attributes key, value and coded_value. copy() now returns a Morsel, not a dict. repr() now contains all attributes. Optimized checking keys and quoting values. Added new tests. Original patch by Demian Brecht.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/http.cookies.rst12
-rw-r--r--Doc/whatsnew/3.5.rst6
2 files changed, 18 insertions, 0 deletions
diff --git a/Doc/library/http.cookies.rst b/Doc/library/http.cookies.rst
index 646f2e8..46c3bbd 100644
--- a/Doc/library/http.cookies.rst
+++ b/Doc/library/http.cookies.rst
@@ -148,16 +148,28 @@ Morsel Objects
The value of the cookie.
+ .. deprecated:: 3.5
+ Setting :attr:`~Morsel.value` directly has been deprecated in favour of
+ using :func:`~Morsel.set`
+
.. attribute:: Morsel.coded_value
The encoded value of the cookie --- this is what should be sent.
+ .. deprecated:: 3.5
+ Setting :attr:`~Morsel.coded_value` directly has been deprecated in
+ favour of using :func:`~Morsel.set`
+
.. attribute:: Morsel.key
The name of the cookie.
+ .. deprecated:: 3.5
+ Setting :attr:`~Morsel.key` directly has been deprecated in
+ favour of using :func:`~Morsel.set`
+
.. method:: Morsel.set(key, value, coded_value)
diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst
index 21fafd0..a70f0b8 100644
--- a/Doc/whatsnew/3.5.rst
+++ b/Doc/whatsnew/3.5.rst
@@ -512,6 +512,12 @@ Deprecated Python modules, functions and methods
``True``, but this default is deprecated. Specify the *decode_data* keyword
with an appropriate value to avoid the deprecation warning.
+* :class:`~http.cookies.Morsel` has previously allowed for setting attributes
+ :attr:`~http.cookies.Morsel.key`, :attr:`~http.cookies.Morsel.value` and
+ :attr:`~http.cookies.Morsel.coded_value`. Use the preferred
+ :func:`~http.cookies.Morsel.set` method in order to avoid the deprecation
+ warning.
+
Deprecated functions and types of the C API
-------------------------------------------