diff options
author | Skip Montanaro <skip@pobox.com> | 2007-08-06 21:07:53 (GMT) |
---|---|---|
committer | Skip Montanaro <skip@pobox.com> | 2007-08-06 21:07:53 (GMT) |
commit | 1e8ce58f5d0db22714d65ff440045a7526ed394d (patch) | |
tree | f705fb923334cffa32492a5bddfcca46ecc27f0a /Demo/xml | |
parent | 28a181cbe82bc79df3b881b79b19e12b2e39911b (diff) | |
download | cpython-1e8ce58f5d0db22714d65ff440045a7526ed394d.zip cpython-1e8ce58f5d0db22714d65ff440045a7526ed394d.tar.gz cpython-1e8ce58f5d0db22714d65ff440045a7526ed394d.tar.bz2 |
remove most uses of list(somedict.keys()) in Demo scripts
Diffstat (limited to 'Demo/xml')
-rw-r--r-- | Demo/xml/elem_count.py | 6 | ||||
-rw-r--r-- | Demo/xml/roundtrip.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Demo/xml/elem_count.py b/Demo/xml/elem_count.py index a2b4647..e083e64 100644 --- a/Demo/xml/elem_count.py +++ b/Demo/xml/elem_count.py @@ -15,7 +15,7 @@ class FancyCounter(handler.ContentHandler): self._attrs = self._attrs + len(attrs) self._elem_types[name] = self._elem_types.get(name, 0) + 1 - for name in list(attrs.keys()): + for name in attrs.keys(): self._attr_types[name] = self._attr_types.get(name, 0) + 1 def endDocument(self): @@ -23,11 +23,11 @@ class FancyCounter(handler.ContentHandler): print("There were", self._attrs, "attributes.") print("---ELEMENT TYPES") - for pair in list(self._elem_types.items()): + for pair in self._elem_types.items(): print("%20s %d" % pair) print("---ATTRIBUTE TYPES") - for pair in list(self._attr_types.items()): + for pair in self._attr_types.items(): print("%20s %d" % pair) diff --git a/Demo/xml/roundtrip.py b/Demo/xml/roundtrip.py index b0e131e..8d7d437 100644 --- a/Demo/xml/roundtrip.py +++ b/Demo/xml/roundtrip.py @@ -22,7 +22,7 @@ class ContentGenerator(handler.ContentHandler): def startElement(self, name, attrs): self._out.write('<' + name) - for (name, value) in list(attrs.items()): + for (name, value) in attrs.items(): self._out.write(' %s="%s"' % (name, saxutils.escape(value))) self._out.write('>') |