From 8f7cf2990f9010ea4924f2525318dff0ba1028d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B0=D1=82=D0=B0=D0=B5=D0=B2=20=D0=94=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=81?= Date: Fri, 17 Mar 2017 14:19:21 -0400 Subject: New features from python 2.7 After bump minimum supported version to 2.7 (1da9d3752160430c91534a8868ceb8c5ad1451d4), we can use new syntax. Change-Id: Ib064c75a00562e641d132f9c57e5e69744200e05 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/347 --- lib/sqlalchemy/sql/compiler.py | 10 +++++----- lib/sqlalchemy/sql/dml.py | 4 ++-- lib/sqlalchemy/sql/operators.py | 4 ++-- lib/sqlalchemy/sql/schema.py | 2 +- lib/sqlalchemy/sql/visitors.py | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index e3bef8f82..441502898 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -50,7 +50,7 @@ RESERVED_WORDS = set([ 'using', 'verbose', 'when', 'where']) LEGAL_CHARACTERS = re.compile(r'^[A-Z0-9_$]+$', re.I) -ILLEGAL_INITIAL_CHARACTERS = set([str(x) for x in range(0, 10)]).union(['$']) +ILLEGAL_INITIAL_CHARACTERS = {str(x) for x in range(0, 10)}.union(['$']) BIND_PARAMS = re.compile(r'(? 1 and not self._allow_multiple_tables: diff --git a/lib/sqlalchemy/sql/visitors.py b/lib/sqlalchemy/sql/visitors.py index 7f0951824..99ceceed1 100644 --- a/lib/sqlalchemy/sql/visitors.py +++ b/lib/sqlalchemy/sql/visitors.py @@ -306,7 +306,7 @@ def replacement_traverse(obj, opts, replace): replacement by a given replacement function.""" cloned = {} - stop_on = set([id(x) for x in opts.get('stop_on', [])]) + stop_on = {id(x) for x in opts.get('stop_on', [])} def clone(elem, **kw): if id(elem) in stop_on or \ -- cgit v1.2.1