summaryrefslogtreecommitdiffstats
path: root/Lib/Cookie.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-11 06:12:03 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-11 06:12:03 (GMT)
commitcc2b0161257495f859200bce0aea3ed7e646feb3 (patch)
treeba09aba0de6447bef5be59b43fb86d17d760833d /Lib/Cookie.py
parent4e66dfcdc495218ad5f98b12ad6b4b2b05630ab0 (diff)
downloadcpython-cc2b0161257495f859200bce0aea3ed7e646feb3.zip
cpython-cc2b0161257495f859200bce0aea3ed7e646feb3.tar.gz
cpython-cc2b0161257495f859200bce0aea3ed7e646feb3.tar.bz2
- PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;
and .keys(), .items(), .values() return dict views. The dict views aren't fully functional yet; in particular, they can't be compared to sets yet. but they are useful as "iterator wells". There are still 27 failing unit tests; I expect that many of these have fairly trivial fixes, but there are so many, I could use help.
Diffstat (limited to 'Lib/Cookie.py')
-rw-r--r--Lib/Cookie.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/Lib/Cookie.py b/Lib/Cookie.py
index fb06840..368a3bb 100644
--- a/Lib/Cookie.py
+++ b/Lib/Cookie.py
@@ -488,8 +488,7 @@ class Morsel(dict):
# Now add any defined attributes
if attrs is None:
attrs = self._reserved
- items = self.items()
- items.sort()
+ items = sorted(self.items())
for K,V in items:
if V == "": continue
if K not in attrs: continue
@@ -582,8 +581,7 @@ class BaseCookie(dict):
def output(self, attrs=None, header="Set-Cookie:", sep="\015\012"):
"""Return a string suitable for HTTP."""
result = []
- items = self.items()
- items.sort()
+ items = sorted(self.items())
for K,V in items:
result.append( V.output(attrs, header) )
return sep.join(result)
@@ -593,8 +591,7 @@ class BaseCookie(dict):
def __repr__(self):
L = []
- items = self.items()
- items.sort()
+ items = sorted(self.items())
for K,V in items:
L.append( '%s=%s' % (K,repr(V.value) ) )
return '<%s: %s>' % (self.__class__.__name__, _spacejoin(L))
@@ -602,8 +599,7 @@ class BaseCookie(dict):
def js_output(self, attrs=None):
"""Return a string suitable for JavaScript."""
result = []
- items = self.items()
- items.sort()
+ items = sorted(self.items())
for K,V in items:
result.append( V.js_output(attrs) )
return _nulljoin(result)