diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-07-16 17:56:53 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-07-16 17:56:53 -0400 |
| commit | 747250587491ad76e30177b232daec5928f5b36d (patch) | |
| tree | 3b27160c4ff9d67c2230146a360bbe07c8b555c5 /lib/sqlalchemy/util/_collections.py | |
| parent | 8f04c5319120773906161548b82a8d83e387843e (diff) | |
| download | sqlalchemy-747250587491ad76e30177b232daec5928f5b36d.tar.gz | |
- justify NamedTuple, now called KeyedTuple
- fix this test
Diffstat (limited to 'lib/sqlalchemy/util/_collections.py')
| -rw-r--r-- | lib/sqlalchemy/util/_collections.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/sqlalchemy/util/_collections.py b/lib/sqlalchemy/util/_collections.py index 801a79e9a..af3be8ec3 100644 --- a/lib/sqlalchemy/util/_collections.py +++ b/lib/sqlalchemy/util/_collections.py @@ -16,10 +16,19 @@ from compat import time_func, threading EMPTY_SET = frozenset() -class NamedTuple(tuple): +class KeyedTuple(tuple): """tuple() subclass that adds labeled names. - Is also pickleable. + Unlike collections.namedtuple, this is + an ad-hoc data structure, not a factory + for new types. + + It's pickleable in-place without the need for stack + frame manipulation, new KeyedTuple types can be created + very quickly and simply (look at the source + to collections.namedtuple for contrast). + + Is used by :class:`.Query` to return result rows. """ |
