diff options
| author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-08-20 20:34:18 +0300 |
|---|---|---|
| committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-08-20 20:34:18 +0300 |
| commit | 267ed99da4f0482d4a964fc98dc6ad14d4bf77cb (patch) | |
| tree | a8c089d99def0503e6a16376c1765c5c3da85476 /astroid/objects.py | |
| parent | d7294bd79062a4f47db8a761d79e6c1dd166bc72 (diff) | |
| download | astroid-git-267ed99da4f0482d4a964fc98dc6ad14d4bf77cb.tar.gz | |
Introduce a base class for Set, List and Tuple in order to avoid code duplication. Closes issue #160.
Diffstat (limited to 'astroid/objects.py')
| -rw-r--r-- | astroid/objects.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/astroid/objects.py b/astroid/objects.py index c2ac9a5f..aa3848a3 100644 --- a/astroid/objects.py +++ b/astroid/objects.py @@ -40,21 +40,12 @@ from astroid import scoped_nodes BUILTINS = six.moves.builtins.__name__ -class FrozenSet(bases.NodeNG, bases.Instance, mixins.ParentAssignTypeMixin): +class FrozenSet(node_classes._BaseContainer): """class representing a FrozenSet composite node""" - def __init__(self, elts=None): - if elts is None: - self.elts = [] - else: - self.elts = [node_classes.const_factory(e) for e in elts] - def pytype(self): return '%s.frozenset' % BUILTINS - def itered(self): - return self.elts - def _infer(self, context=None): yield self @@ -63,9 +54,6 @@ class FrozenSet(bases.NodeNG, bases.Instance, mixins.ParentAssignTypeMixin): builtins = MANAGER.astroid_cache[BUILTINS] return builtins.getattr('frozenset')[0] - def bool_value(self): - return bool(self.elts) - class Super(bases.NodeNG): """Proxy class over a super call. |
