From e51fbdff1d111a39dd78bb5e6b1ab1d8f599e51b Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Sun, 30 Mar 2014 14:24:33 +0200 Subject: Add flake8 to tox configuration and code cleanup. --- sqlparse/sql.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'sqlparse/sql.py') diff --git a/sqlparse/sql.py b/sqlparse/sql.py index 6174db0..0fe92c7 100644 --- a/sqlparse/sql.py +++ b/sqlparse/sql.py @@ -220,18 +220,10 @@ class TokenList(Token): else: yield token -# def __iter__(self): -# return self -# -# def next(self): -# for token in self.tokens: -# yield token - def is_group(self): return True def get_sublists(self): -# return [x for x in self.tokens if isinstance(x, TokenList)] for x in self.tokens: if isinstance(x, TokenList): yield x @@ -629,10 +621,9 @@ class Function(TokenList): for t in parenthesis.tokens: if isinstance(t, IdentifierList): return t.get_identifiers() - elif isinstance(t, Identifier) or \ - isinstance(t, Function) or \ - t.ttype in T.Literal: - return [t,] + elif (isinstance(t, (Identifier, Function)) + or t.ttype in T.Literal): + return [t] return [] -- cgit v1.2.1