mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
remove most uses of list(somedict.keys()) in Demo scripts
This commit is contained in:
parent
28a181cbe8
commit
1e8ce58f5d
17 changed files with 31 additions and 46 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue