> Named tuples eliminate neediness in values & values_list because they
> have all their features.
Not in your implementation. The order of fields in each tuple
corresponds to order in sql but not to order of fields in
namedtuples() call. See ValuesListQueryset.iterator() implementation
for detail
On Mon, Jul 4, 2011 at 11:19 AM, Paul Miller wrote:
> Hi Yuri,
>
> I have not tested them for speed, but:
>
> - Named tuples have no instance dictionary, so their instances take no more
> space than a regular tuple (for example, casting thousands of sql records to
> named tuples has zero memory
I was told that for Python 2.5 nametuples "emulation" is 8 times
slower than regular tuples and dicts.
That's why I'm interested in benchmarks. If it's significantly slower
(at least for Python 2.4 and 2.5), this should be mentioned in docs.
On Mon, Jul 4, 2011 at 5:19 PM, Paul Miller wrote:
> Hi
Hi Yuri,
I have not tested them for speed, but:
- Named tuples have no instance dictionary, so their instances take no more
space than a regular tuple (for example, casting thousands of sql records to
named tuples has zero memory overhead).
- They also use C-speed attribute lookup using propert
Hi Paul,
Is it correct that nametuple construction is much slower than for
normal ones or is this true only in older python versions?
On Mon, Jul 4, 2011 at 1:47 AM, paulpmillr wrote:
> Hello.
>
> I've added an implementation for named tuples query set, see
> https://code.djangoproject.com/ticke
Hello.
I've added an implementation for named tuples query set, see
https://code.djangoproject.com/ticket/15648
- Named tuples could be iterated over with order saving (like lists /
tuples).
- Properties there could be accessed with dot notation - post.topic
(almost like dicts).
- They could be c