diff options
| author | Ben Pfaff <blp@nicira.com> | 2011-08-23 09:50:46 -0700 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2011-08-24 11:57:42 -0700 |
| commit | 8758e8a373338e409d7f2863ee91e01060f35628 (patch) | |
| tree | 8006fedcf72ad981c9b98d15c80b0aee376c0a9a /python/ovs/db/parser.py | |
| parent | d272c10ecdba8a5dc7adba30c98d8d4273dfd1ae (diff) | |
| download | openvswitch-8758e8a373338e409d7f2863ee91e01060f35628.tar.gz | |
python: Avoid using 'type' as a variable name.
'type' is a Python built-in function, so it's best to avoid using it as
a variable name.
Reported-by: Reid Price <reid@nicira.com>
Diffstat (limited to 'python/ovs/db/parser.py')
| -rw-r--r-- | python/ovs/db/parser.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/python/ovs/db/parser.py b/python/ovs/db/parser.py index 073f76062..67b3bd53c 100644 --- a/python/ovs/db/parser.py +++ b/python/ovs/db/parser.py @@ -75,18 +75,18 @@ id_re = re.compile("[_a-zA-Z][_a-zA-Z0-9]*$") def is_identifier(s): return type(s) in [str, unicode] and id_re.match(s) -def json_type_to_string(type): - if type == None: +def json_type_to_string(type_): + if type_ == None: return "null" - elif type == bool: + elif type_ == bool: return "boolean" - elif type == dict: + elif type_ == dict: return "object" - elif type == list: + elif type_ == list: return "array" - elif type in [int, long, float]: + elif type_ in [int, long, float]: return "number" - elif type in [str, unicode]: + elif type_ in [str, unicode]: return "string" else: return "<invalid>" |
