summaryrefslogtreecommitdiff
path: root/checkers/variables.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2014-09-11 15:09:23 +0300
committerClaudiu Popa <pcmanticore@gmail.com>2014-09-11 15:09:23 +0300
commit0f35d10d1c629a6bc029bcfb31f903c6c9beafbe (patch)
treeef2a8c0fb9740564ebf7ed7ca0f424fd11d1d432 /checkers/variables.py
parent8b20ef84809556a19e32314efdd53a5f31754ed5 (diff)
downloadpylint-git-0f35d10d1c629a6bc029bcfb31f903c6c9beafbe.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.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/checkers/variables.py b/checkers/variables.py
index df39f1015..8bd05b329 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()