diff options
| author | Claudiu Popa <pcmanticore@gmail.com> | 2015-11-29 18:03:32 +0200 |
|---|---|---|
| committer | Claudiu Popa <pcmanticore@gmail.com> | 2015-11-29 18:03:32 +0200 |
| commit | 469b8151b451627c9a9f03e2e13be9b755d2a92e (patch) | |
| tree | c6d648e7f0b2900ed4b4971f06f03c8c6d9337d2 | |
| parent | 71c4cc5a6ee59edf0bad1d81cf79295b5eb3f996 (diff) | |
| download | astroid-git-469b8151b451627c9a9f03e2e13be9b755d2a92e.tar.gz | |
Disable redefined-variable-type for now.
--HG--
branch : 1.4.0
| -rw-r--r-- | astroid/manager.py | 1 | ||||
| -rw-r--r-- | astroid/protocols.py | 2 | ||||
| -rw-r--r-- | astroid/rebuilder.py | 11 | ||||
| -rw-r--r-- | astroid/scoped_nodes.py | 1 | ||||
| -rw-r--r-- | astroid/tests/unittest_inference.py | 1 |
5 files changed, 10 insertions, 6 deletions
diff --git a/astroid/manager.py b/astroid/manager.py index 6d27103a..d08adc29 100644 --- a/astroid/manager.py +++ b/astroid/manager.py @@ -167,6 +167,7 @@ class AstroidManager(object): return None def file_from_module_name(self, modname, contextfile): + # pylint: disable=redefined-variable-type try: value = self._mod_file_cache[(modname, contextfile)] except KeyError: diff --git a/astroid/protocols.py b/astroid/protocols.py index 20cbea9e..d92edac3 100644 --- a/astroid/protocols.py +++ b/astroid/protocols.py @@ -398,8 +398,6 @@ def with_assigned_stmts(self, node, context=None, asspath=None): if isinstance(lst, (nodes.Tuple, nodes.List)): for item in lst.nodes: yield item -nodes.With.assigned_stmts = bases.raise_if_nothing_inferred(with_assigned_stmts) - nodes.With.assigned_stmts = with_assigned_stmts diff --git a/astroid/rebuilder.py b/astroid/rebuilder.py index f1a2ff3b..eee401ca 100644 --- a/astroid/rebuilder.py +++ b/astroid/rebuilder.py @@ -279,10 +279,10 @@ class TreeRebuilder(object): # problem for the correctness of the program). # # ("a" + "b" + # one thousand more + "c") - newnode = self._peepholer.optimize_binop(node) - if newnode: - _lineno_parent(node, newnode, parent) - return newnode + optimized = self._peepholer.optimize_binop(node) + if optimized: + _lineno_parent(node, optimized, parent) + return optimized newnode = new.BinOp() _lineno_parent(node, newnode, parent) @@ -553,6 +553,7 @@ class TreeRebuilder(object): def visit_attribute(self, node, parent, assign_ctx=None): """visit a Getattr node by returning a fresh instance of it""" + # pylint: disable=redefined-variable-type if assign_ctx == "Del": # FIXME : maybe we should reintroduce and visit_delattr ? # for instance, deactivating asscontext @@ -652,6 +653,7 @@ class TreeRebuilder(object): """visit a Name node by returning a fresh instance of it""" # True and False can be assigned to something in py2x, so we have to # check first the asscontext + # pylint: disable=redefined-variable-type if assign_ctx == "Del": newnode = new.DelName() elif assign_ctx is not None: # Ass @@ -891,6 +893,7 @@ class TreeRebuilder3k(TreeRebuilder): def visit_try(self, node, parent, assign_ctx=None): # python 3.3 introduce a new Try node replacing TryFinally/TryExcept nodes + # pylint: disable=redefined-variable-type if node.finalbody: newnode = new.TryFinally() _lineno_parent(node, newnode, parent) diff --git a/astroid/scoped_nodes.py b/astroid/scoped_nodes.py index 3d0aeba2..ea1dbdb8 100644 --- a/astroid/scoped_nodes.py +++ b/astroid/scoped_nodes.py @@ -1189,6 +1189,7 @@ class ClassDef(mixins.FilterStmtsMixin, LocalsDictNodeNG, bases.Statement): yield bases.Instance(self) def scope_lookup(self, node, name, offset=0): + # pylint: disable=redefined-variable-type if any(node == base or base.parent_of(node) for base in self.bases): # Handle the case where we have either a name diff --git a/astroid/tests/unittest_inference.py b/astroid/tests/unittest_inference.py index 7ac97c0c..86497727 100644 --- a/astroid/tests/unittest_inference.py +++ b/astroid/tests/unittest_inference.py @@ -1059,6 +1059,7 @@ class InferenceTest(resources.SysPathSetup, unittest.TestCase): self.assertEqual(bar_class._instance_attrs, {'attr': [assattr]}) def test_python25_generator_exit(self): + # pylint: disable=redefined-variable-type buffer = six.StringIO() sys.stderr = buffer try: |
