diff options
author | cpopa <devnull@localhost> | 2014-09-11 15:09:23 +0300 |
---|---|---|
committer | cpopa <devnull@localhost> | 2014-09-11 15:09:23 +0300 |
commit | 56f660a2e80e36fb997ac1de5ff1b720e1ddab27 (patch) | |
tree | 3d1a47d669b62316134b2efea8a3c9bd8c09a84c /checkers/variables.py | |
parent | c3baa296b2d3d22dd5c4e7abbc5adc6c2a9b19aa (diff) | |
download | pylint-56f660a2e80e36fb997ac1de5ff1b720e1ddab27.tar.gz |
Don't emit 'unbalanced-tuple-unpacking' when the rhs of the assignment is a variable length argument. Closes issue #329.
Diffstat (limited to 'checkers/variables.py')
-rw-r--r-- | checkers/variables.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/checkers/variables.py b/checkers/variables.py index df39f10..8bd05b3 100644 --- a/checkers/variables.py +++ b/checkers/variables.py @@ -911,6 +911,11 @@ builtins. Remember that you should avoid to define new builtins when possible.' """ if infered is astroid.YES: return + if (isinstance(infered.parent, astroid.Arguments) and + isinstance(node.value, astroid.Name) and + node.value.name == infered.parent.vararg): + # Variable-length argument, we can't determine the length. + return if isinstance(infered, (astroid.Tuple, astroid.List)): # attempt to check unpacking is properly balanced values = infered.itered() |