From 043783c20b4f330c9d068d9000bfdc630977ff5d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 25 Aug 2012 11:54:58 +0000 Subject: [PATCH] use set's when checking against multiple types. --- release/scripts/modules/rna_xml.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release/scripts/modules/rna_xml.py b/release/scripts/modules/rna_xml.py index 5354fd1c776..a259a4ec396 100644 --- a/release/scripts/modules/rna_xml.py +++ b/release/scripts/modules/rna_xml.py @@ -99,11 +99,11 @@ def rna2xml(fw=print_ln, subvalue = getattr(value, prop) subvalue_type = type(subvalue) - if subvalue_type in (int, bool, float): + if subvalue_type in {int, bool, float}: node_attrs.append("%s=\"%s\"" % (prop, number_to_str(subvalue, subvalue_type))) elif subvalue_type is str: node_attrs.append("%s=%s" % (prop, quoteattr(subvalue))) - elif subvalue_type == set: + elif subvalue_type is set: node_attrs.append("%s=%s" % (prop, quoteattr("{" + ",".join(list(subvalue)) + "}"))) elif subvalue is None: node_attrs.append("%s=\"NONE\"" % prop) @@ -137,7 +137,7 @@ def rna2xml(fw=print_ln, # default def str_recursive(s): subsubvalue_type = type(s) - if subsubvalue_type in (int, float, bool): + if subsubvalue_type in {int, float, bool}: return number_to_str(s, subsubvalue_type) else: return " ".join([str_recursive(si) for si in s])