From 8d91eb2bcc14f5041d6e85984606519841ce93b0 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sun, 11 Mar 2018 22:37:00 +0000 Subject: [PATCH] Remove more redundant uses of .keys() Signed-off-by: Niels Thykier --- scour/scour.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scour/scour.py b/scour/scour.py index ac91561..5c64ee2 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -1620,7 +1620,7 @@ def styleInheritedFromParent(node, style): # check styles first (they take precedence over presentation attributes) styles = _getStyle(parentNode) - if style in styles.keys(): + if style in styles: value = styles[style] if not value == 'inherit': return value @@ -1660,7 +1660,7 @@ def styleInheritedByChild(node, style, nodeIsChild=False): return False # check styles styles = _getStyle(node) - if (style in styles.keys()) and not (styles[style] == 'inherit'): + if (style in styles) and not (styles[style] == 'inherit'): return False else: # if the passed-in node does not have any children 'style' can obviously not be inherited @@ -3229,7 +3229,7 @@ def serializeXML(element, options, indent_depth=0, preserveWhitespace=False): if name in attrName2Index: attrIndices.append(attrName2Index[name]) del attrName2Index[name] - attrIndices += [attrName2Index[name] for name in sorted(attrName2Index.keys())] + attrIndices += [attrName2Index[name] for name in sorted(attrName2Index)] for index in attrIndices: attr = attrList.item(index)