summaryrefslogtreecommitdiff
path: root/astroid/helpers.py
diff options
context:
space:
mode:
authorBryce Guinta <bryce.paul.guinta@gmail.com>2018-03-11 01:21:24 -0700
committerBryce Guinta <bryce.paul.guinta@gmail.com>2018-03-11 01:25:12 -0700
commit67c7158920f38ffab3c846beda563d61e00ef0f5 (patch)
tree98bf40eecf8ef6e0a867f28a3134d1b05ca446b5 /astroid/helpers.py
parentdea855281856debe9bddc9b5ceae02884683edcf (diff)
downloadastroid-git-67c7158920f38ffab3c846beda563d61e00ef0f5.tar.gz
Locally import FrozenSet node to avoid circular import
Diffstat (limited to 'astroid/helpers.py')
-rw-r--r--astroid/helpers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/astroid/helpers.py b/astroid/helpers.py
index cd472af2..f55792b6 100644
--- a/astroid/helpers.py
+++ b/astroid/helpers.py
@@ -236,12 +236,13 @@ def object_len(node, context=None):
or if multiple nodes are inferred
:rtype int: Integer length of node
"""
+ from astroid.objects import FrozenSet
inferred_node = safe_infer(node, context=context)
if inferred_node is None or inferred_node is util.Uninferable:
raise exceptions.InferenceError(node=node)
if inferred_node.qname() in ('builtins.str', 'builtins.bytes'):
return len(inferred_node.value)
- if isinstance(inferred_node, (nodes.List, nodes.Set, nodes.Tuple, nodes.FrozenSet)):
+ if isinstance(inferred_node, (nodes.List, nodes.Set, nodes.Tuple, FrozenSet)):
return len(inferred_node.elts)
if isinstance(inferred_node, nodes.Dict):
return len(inferred_node.items)