From 5742e321b261c0c1303835b80418cd3cdc1b5643 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 26 Jan 2016 17:28:40 -0500 Subject: - unfortunately we need to match within join where col.key does not match what's given so we need to use a set() here. contains_column is not within any performance paths --- lib/sqlalchemy/sql/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py index 48b9a8a2b..97fb04dd9 100644 --- a/lib/sqlalchemy/sql/base.py +++ b/lib/sqlalchemy/sql/base.py @@ -579,8 +579,7 @@ class ColumnCollection(util.OrderedProperties): object.__setattr__(self, '_all_columns', state['_all_columns']) def contains_column(self, col): - existing = self._data.get(col.key) - return existing is not None and hash(existing) == hash(col) + return col in set(self._all_columns) def as_immutable(self): return ImmutableColumnCollection(self._data, self._all_columns) -- cgit v1.2.1