diff options
author | cpopa <devnull@localhost> | 2014-06-23 10:24:47 +0300 |
---|---|---|
committer | cpopa <devnull@localhost> | 2014-06-23 10:24:47 +0300 |
commit | 8802015048ce815bca56dc185e95b6e174021703 (patch) | |
tree | b9444a7135aadd4ab8c542def55dda098cb43e02 | |
parent | 8483af3e3f66d3e9ae987c668f7414d0dde7df19 (diff) | |
download | pylint-8802015048ce815bca56dc185e95b6e174021703.tar.gz |
No need for a deque here.
-rw-r--r-- | checkers/strings.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/checkers/strings.py b/checkers/strings.py index d5a312c..a15206d 100644 --- a/checkers/strings.py +++ b/checkers/strings.py @@ -21,7 +21,6 @@ import sys import tokenize import string -from collections import deque import astroid @@ -180,10 +179,8 @@ def get_access_path(key, parts): """ Given a list of format specifiers, returns the final access path (e.g. a.b.c[0][1]) """ - parts = deque(parts[:]) path = [] - while parts: - is_attribute, specifier = parts.popleft() + for is_attribute, specifier in parts: if is_attribute: path.append(".{}".format(specifier)) else: @@ -394,14 +391,12 @@ class StringMethodsChecker(BaseChecker): # No need to check this key if it doesn't # use attribute / item access continue + previous = argument - specifiers = deque(specifiers[:]) parsed = [] - - while specifiers: + for is_attribute, specifier in specifiers: if previous is astroid.YES: break - is_attribute, specifier = specifiers.popleft() parsed.append((is_attribute, specifier)) if is_attribute: try: |