diff options
author | David Shea <dshea@redhat.com> | 2014-07-08 08:46:53 -0400 |
---|---|---|
committer | David Shea <dshea@redhat.com> | 2014-07-08 08:46:53 -0400 |
commit | bf5ee7f5b9f5258b8fc153aaf68ab5412ded336f (patch) | |
tree | 50d8ed5e196d71c10831f0b18851a35259671613 /checkers | |
parent | f496577ae6b172f7188a1196bbf0bdf865498485 (diff) | |
download | pylint-bf5ee7f5b9f5258b8fc153aaf68ab5412ded336f.tar.gz |
Move the sequence_types set to the global level
Diffstat (limited to 'checkers')
-rw-r--r-- | checkers/typecheck.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/checkers/typecheck.py b/checkers/typecheck.py index dfbce61..3bcb099 100644 --- a/checkers/typecheck.py +++ b/checkers/typecheck.py @@ -86,6 +86,10 @@ MSGS = { with an __index__ method.'), } +# builtin sequence types in Python 2 and 3. +sequence_types = set(['str', 'unicode', 'list', 'tuple', 'bytearray', + 'xrange', 'range', 'bytes', 'memoryview']) + def _determine_callable(callable_obj): # Ordering is important, since BoundMethod is a subclass of UnboundMethod, # and Function inherits Lambda. @@ -538,9 +542,6 @@ accessed. Python regular expressions are accepted.'} # If the types can be determined, only allow indices to be int, # slice or instances with __index__. - sequence_types = set(['str', 'unicode', 'list', 'tuple', 'bytearray', - 'xrange', 'range', 'bytes', 'memoryview']) - parent_type = safe_infer(node.parent.value) if not isinstance(parent_type, (astroid.Class, astroid.Instance)): |