From 4e8ae03682d346b2a57dc9d4760d838ec9674804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s=20Combarro=20=22Piranna=22?= Date: Fri, 3 Feb 2012 15:22:05 +0100 Subject: Changed get_identifiers() to be a generator --- sqlparse/sql.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sqlparse/sql.py') 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): -- cgit v1.2.1