diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-02-21 22:20:13 +0200 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-02-21 22:20:13 +0200 |
commit | ada48fb1d7776994341e1fa7522e3f13e41a7f53 (patch) | |
tree | 489eb3ba16b5ba1161f0efe0026b6401b113b633 /pylint/checkers/python3.py | |
parent | 062999db0385f9f3f31df47f1ddbf84271ad0ab8 (diff) | |
download | pylint-ada48fb1d7776994341e1fa7522e3f13e41a7f53.tar.gz |
Don't emit not-iterating warnings when the builtin is used in an unpacking.
Diffstat (limited to 'pylint/checkers/python3.py')
-rw-r--r-- | pylint/checkers/python3.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pylint/checkers/python3.py b/pylint/checkers/python3.py index e708c4a..a60d0de 100644 --- a/pylint/checkers/python3.py +++ b/pylint/checkers/python3.py @@ -78,6 +78,12 @@ def _in_iterating_context(node): elif isinstance(parent.func, astroid.Getattr): if parent.func.attrname == 'join': return True + # If the call is in an unpacking, there's no need to warn, + # since it can be considered iterating. + elif (isinstance(parent, astroid.Assign) and + isinstance(parent.targets[0], (astroid.List, astroid.Tuple))): + if len(parent.targets[0].elts) > 1: + return True return False |