mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
- 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.
This commit is contained in:
parent
4e66dfcdc4
commit
cc2b016125
73 changed files with 317 additions and 272 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue