diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-12-02 11:15:12 +0100 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-12-02 11:15:12 +0100 |
commit | 1dde1727e2b6ec58e8940c9e6677ea76da3d3489 (patch) | |
tree | 9a76436960c289a7beddf34992a60afd93661d3c | |
parent | 81eaf2cf9a021e4ac1684a4b67bf11d87d9be3f0 (diff) | |
download | astroid-git-1dde1727e2b6ec58e8940c9e6677ea76da3d3489.tar.gz |
cleanup: BaseClass is no more needed
-rw-r--r-- | bases.py | 13 | ||||
-rw-r--r-- | mixins.py | 7 | ||||
-rw-r--r-- | node_classes.py | 4 | ||||
-rw-r--r-- | scoped_nodes.py | 2 |
4 files changed, 8 insertions, 18 deletions
@@ -41,15 +41,6 @@ from __future__ import generators __docformat__ = "restructuredtext en" -try: - from _ast import AST - del AST - class BaseClass(object): - pass -except ImportError: - class BaseClass: - pass - from logilab.common.compat import builtins from logilab.astng.exceptions import InferenceError, ASTNGError, \ NotFoundError, UnresolvableName @@ -57,7 +48,7 @@ from logilab.astng.as_string import as_string BUILTINS_NAME = builtins.__name__ -class Proxy(BaseClass): +class Proxy(object): """a simple proxy object""" _proxied = None @@ -341,7 +332,7 @@ def raise_if_nothing_infered(func): # Node ###################################################################### -class NodeNG(BaseClass): +class NodeNG(object): """Base Class for all ASTNG node classes. It represents a node of the new abstract syntax tree. @@ -35,13 +35,12 @@ from logilab.astng.exceptions import (ASTNGBuildingException, InferenceError, NotFoundError) -from logilab.astng.bases import BaseClass # /!\ We cannot build a StmtNode(NodeNG) class since modifying "__bases__" # in "nodes.py" has to work *both* for old-style and new-style classes, # but we need the StmtMixIn for scoped nodes -class StmtMixIn(BaseClass): +class StmtMixIn(object): """StmtMixIn used only for a adding a few attributes""" is_statement = True @@ -62,7 +61,7 @@ class StmtMixIn(BaseClass): return stmts[index -1] -class BlockRangeMixIn(BaseClass): +class BlockRangeMixIn(object): """override block range """ def set_line_info(self, lastchild): self.fromlineno = self.lineno @@ -119,7 +118,7 @@ class ParentAssignTypeMixin(AssignTypeMixin): -class FromImportMixIn(BaseClass, FilterStmtsMixin): +class FromImportMixIn(FilterStmtsMixin): """MixIn for From and Import Nodes""" def _infer_name(self, frame, name): diff --git a/node_classes.py b/node_classes.py index 26cac7ac..baafb021 100644 --- a/node_classes.py +++ b/node_classes.py @@ -23,7 +23,7 @@ import sys from logilab.astng.exceptions import NoDefault -from logilab.astng.bases import NodeNG, BaseClass, Instance, copy_context, \ +from logilab.astng.bases import NodeNG, Instance, copy_context, \ _infer_stmts, YES from logilab.astng.mixins import StmtMixIn, BlockRangeMixIn, AssignTypeMixin, \ ParentAssignTypeMixin, FromImportMixIn @@ -98,7 +98,7 @@ def are_exclusive(stmt1, stmt2, exceptions=None): return False -class LookupMixIn(BaseClass): +class LookupMixIn(object): """Mixin looking up a name in the right scope """ diff --git a/scoped_nodes.py b/scoped_nodes.py index 336f0b1c..b52dbbb0 100644 --- a/scoped_nodes.py +++ b/scoped_nodes.py @@ -37,7 +37,7 @@ from logilab.astng.exceptions import NotFoundError, NoDefault, \ from logilab.astng.node_classes import Const, DelName, DelAttr, \ Dict, From, List, Name, Pass, Raise, Return, Tuple, Yield, \ are_exclusive, LookupMixIn, const_factory as cf, unpack_infer -from logilab.astng.bases import NodeNG, BaseClass, InferenceContext, Instance,\ +from logilab.astng.bases import NodeNG, InferenceContext, Instance,\ YES, Generator, UnboundMethod, BoundMethod, _infer_stmts, copy_context, \ BUILTINS_NAME from logilab.astng.mixins import StmtMixIn, FilterStmtsMixin |