summaryrefslogtreecommitdiff
path: root/sqlparse/sql.py
diff options
context:
space:
mode:
authorJesús Leganés Combarro "Piranna" <piranna@gmail.com>2012-02-03 15:22:05 +0100
committerJesús Leganés Combarro "Piranna" <piranna@gmail.com>2012-02-03 15:22:05 +0100
commit4e8ae03682d346b2a57dc9d4760d838ec9674804 (patch)
tree056c49cb7c8c6ca14a299748a3692dc6ee488e21 /sqlparse/sql.py
parentc1b05d502b715558076e0d54008b846e27299d41 (diff)
downloadsqlparse-4e8ae03682d346b2a57dc9d4760d838ec9674804.tar.gz
Changed get_identifiers() to be a generator
Diffstat (limited to 'sqlparse/sql.py')
-rw-r--r--sqlparse/sql.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/sqlparse/sql.py b/sqlparse/sql.py
index ddb85a1..1bc6b08 100644
--- a/sqlparse/sql.py
+++ b/sqlparse/sql.py
@@ -437,10 +437,11 @@ class IdentifierList(TokenList):
def get_identifiers(self):
"""Returns the identifiers.
- Whitespaces and punctuations are not included in this list.
+ Whitespaces and punctuations are not included in this generator.
"""
- return [x for x in self.tokens
- if not x.is_whitespace() and not x.match(T.Punctuation, ',')]
+ for x in self.tokens:
+ if not x.is_whitespace() and not x.match(T.Punctuation, ','):
+ yield x
class Parenthesis(TokenList):