From 64c1f2e5688879e1cc087f4e4a893d32267fd1fb Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 14 May 2015 19:22:53 -0400 Subject: [PATCH] - The "lightweight named tuple" used when a :class:`.Query` returns rows failed to implement ``__slots__`` correctly such that it still had a ``__dict__``. This is resolved, but in the extremely unlikely case someone was assigning values to the returned tuples, that will no longer work. fixes #3420 --- doc/build/changelog/changelog_10.rst | 10 ++++++++++ lib/sqlalchemy/util/_collections.py | 2 ++ 2 files changed, 12 insertions(+) diff --git a/doc/build/changelog/changelog_10.rst b/doc/build/changelog/changelog_10.rst index 4e42765613..0a012962f8 100644 --- a/doc/build/changelog/changelog_10.rst +++ b/doc/build/changelog/changelog_10.rst @@ -18,6 +18,16 @@ .. changelog:: :version: 1.0.5 + .. change:: + :tags: bug, orm + :tickets: 3420 + + The "lightweight named tuple" used when a :class:`.Query` returns + rows failed to implement ``__slots__`` correctly such that it still + had a ``__dict__``. This is resolved, but in the extremely + unlikely case someone was assigning values to the returned tuples, + that will no longer work. + .. change:: :tags: bug, pool :tickets: 3419 diff --git a/lib/sqlalchemy/util/_collections.py b/lib/sqlalchemy/util/_collections.py index 5c62ebed86..3869775cf7 100644 --- a/lib/sqlalchemy/util/_collections.py +++ b/lib/sqlalchemy/util/_collections.py @@ -19,6 +19,8 @@ EMPTY_SET = frozenset() class AbstractKeyedTuple(tuple): + __slots__ = () + def keys(self): """Return a list of string key names for this :class:`.KeyedTuple`. -- 2.47.3