From becd78503f096e74adde319b2726b052b2353921 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 28 Aug 2014 12:41:50 -0400 Subject: - this is small optimization, currently it's the best we can do for #3175. fixes #3175 (for now) --- lib/sqlalchemy/sql/annotation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/annotation.py b/lib/sqlalchemy/sql/annotation.py index 02f5c3c1c..3df4257d4 100644 --- a/lib/sqlalchemy/sql/annotation.py +++ b/lib/sqlalchemy/sql/annotation.py @@ -46,6 +46,7 @@ class Annotated(object): self.__dict__ = element.__dict__.copy() self.__element = element self._annotations = values + self._hash = hash(element) def _annotate(self, values): _values = self._annotations.copy() @@ -87,7 +88,7 @@ class Annotated(object): return self.__class__(clone, self._annotations) def __hash__(self): - return hash(self.__element) + return self._hash def __eq__(self, other): if isinstance(self.__element, operators.ColumnOperators): -- cgit v1.2.1