diff options
author | Jonathan Ellis <jbellis@gmail.com> | 2007-08-03 13:57:40 +0000 |
---|---|---|
committer | Jonathan Ellis <jbellis@gmail.com> | 2007-08-03 13:57:40 +0000 |
commit | d7575a738d420a564e7a22f3347ab8f4442110bb (patch) | |
tree | 6c830566e7af1aa47c91ff745503532a03f7a8cd /lib/sqlalchemy/databases | |
parent | 42812c06c182b236f491cb33315527a54fcba002 (diff) | |
download | sqlalchemy-d7575a738d420a564e7a22f3347ab8f4442110bb.tar.gz |
switch (simple) occurences of 'if len(x)' to 'if x': find . -name '*.py' |xargs perl -pi.bak -e 's/if len\((\S+)\):/if $1:/' && find . -name '*.bak' |xargs rm
Diffstat (limited to 'lib/sqlalchemy/databases')
-rw-r--r-- | lib/sqlalchemy/databases/firebird.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/databases/informix.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/databases/sqlite.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/databases/firebird.py b/lib/sqlalchemy/databases/firebird.py index 065894437..307fceb48 100644 --- a/lib/sqlalchemy/databases/firebird.py +++ b/lib/sqlalchemy/databases/firebird.py @@ -318,7 +318,7 @@ class FBCompiler(ansisql.ANSICompiler): return self.process(alias.original, asfrom=True) def visit_function(self, func): - if len(func.clauses): + if func.clauses: return super(FBCompiler, self).visit_function(func) else: return func.name diff --git a/lib/sqlalchemy/databases/informix.py b/lib/sqlalchemy/databases/informix.py index b4471df58..e98a5467e 100644 --- a/lib/sqlalchemy/databases/informix.py +++ b/lib/sqlalchemy/databases/informix.py @@ -407,7 +407,7 @@ class InfoCompiler(ansisql.ANSICompiler): return "" def __visit_label(self, label): - if len(self.select_stack): + if self.select_stack: self.typemap.setdefault(label.name.lower(), label.obj.type) if self.strings[label.obj]: self.strings[label] = self.strings[label.obj] + " AS " + label.name diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index d4a2ac59f..e95951f4a 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -1136,7 +1136,7 @@ class MySQLDialect(ansisql.ANSIDialect): ssl[key[4:]] = opts[key] util.coerce_kw_type(ssl, key[4:], str) del opts[key] - if len(ssl): + if ssl: opts['ssl'] = ssl # FOUND_ROWS must be set in CLIENT_FLAGS to enable diff --git a/lib/sqlalchemy/databases/sqlite.py b/lib/sqlalchemy/databases/sqlite.py index 3f16c2b0d..15f6a2065 100644 --- a/lib/sqlalchemy/databases/sqlite.py +++ b/lib/sqlalchemy/databases/sqlite.py @@ -331,7 +331,7 @@ class SQLiteCompiler(ansisql.ANSICompiler): if self.dialect.supports_cast: return super(SQLiteCompiler, self).visit_cast(cast) else: - if len(self.select_stack): + if self.select_stack: # not sure if we want to set the typemap here... self.typemap.setdefault("CAST", cast.type) return self.process(cast.clause) |