diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-03-17 15:55:15 +0100 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-03-17 15:55:15 +0100 |
commit | 82df6145be5f8f138529a411af2d16ef12fe0ae7 (patch) | |
tree | 150da9e03a7340dfc8e275168a2bd6a590a4381a /inference.py | |
parent | 4531d7727d6f265c0b583bceba703555c0abb646 (diff) | |
download | astroid-git-82df6145be5f8f138529a411af2d16ef12fe0ae7.tar.gz |
fix missing Subscript.infer_lhs and UNARY_OP_METHOD
* add a Subscript.infer_lhs method
* add '~': '__invert__' to the UNARY_OP_METHOD dictionary
--HG--
branch : rebuild
Diffstat (limited to 'inference.py')
-rw-r--r-- | inference.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/inference.py b/inference.py index 8522a30c..2e75d1f6 100644 --- a/inference.py +++ b/inference.py @@ -286,12 +286,14 @@ def infer_subscript(self, context=None): else: raise InferenceError() nodes.Subscript.infer = path_wrapper(infer_subscript) +nodes.Subscript.infer_lhs = raise_if_nothing_infered(infer_subscript) -UNARY_OP_METHOD = {'+': '__pos__', - '-': '__neg__', - 'not': None, # XXX not '__nonzero__' - } +UNARY_OP_METHOD = {'+': '__pos__', + '-': '__neg__', + '~': '__invert__', + 'not': None, # XXX not '__nonzero__' + } def infer_unaryop(self, context=None): for operand in self.operand.infer(context): |