[Python-Dev] Py2.6 ideas (original) (raw)
Phillip J. Eby pje at telecommunity.com
Fri Feb 16 17:41:51 CET 2007
- Previous message: [Python-Dev] Py2.6 ideas
- Next message: [Python-Dev] Py2.6 ideas
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 01:38 PM 2/16/2007 +0100, Martin v. Löwis wrote:
Nick Coghlan schrieb: > However, another aspect that occurred to me is that inheriting from > tuple has significant practical benefits in terms of speed and memory > consumption, at which point it doesn't seem worthwhile to remove the > indexing capability.
I'm not so sure that inheriting from tuple, and giving it named fields, has significant speed and memory benefits. In particular for the memory benefits, you can use slots to achieve the same effects, and more efficiently so (because it you don't store the tuple length). As for speed, I would have to see measurements to be convinced it is faster.
For an otherwise-pure Python implementation, the performance benefit of inheriting from a tuple is in having ready-made C implementations of hashing and comparison.
- Previous message: [Python-Dev] Py2.6 ideas
- Next message: [Python-Dev] Py2.6 ideas
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]