From: Mike Bayer Date: Thu, 28 Aug 2014 16:41:50 +0000 (-0400) Subject: - this is small optimization, currently it's the best we can do X-Git-Tag: rel_1_0_0b1~205^2~38 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=becd78503f096e74adde319b2726b052b2353921;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - this is small optimization, currently it's the best we can do for #3175. fixes #3175 (for now) --- diff --git a/lib/sqlalchemy/sql/annotation.py b/lib/sqlalchemy/sql/annotation.py index 02f5c3c1c4..3df4257d45 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):