[Python-Dev] Tuples vs. lists (original) (raw)
M.-A. Lemburg mal@lemburg.com
Tue, 05 Feb 2002 11:46:37 +0100
- Previous message: [Python-Dev] Tuples vs. lists
- Next message: [Python-Dev] Tuples vs. lists
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I haven't really followed this thread, but what's all this talk about lists vs. tuples about ?
Tuples have a smaller memory footprint, provide faster element access, can be cached and are generally a good data type for constant data structures. Lists, OTOH, provide more flexibility when the size of the object isn't known in advance. They use up more memory, are not cacheable and slower on access.
For the BCD stuff Aahz was talking about, I'd suggest to have a look at either arrays or cStringIO buffers.
Jeremy Hylton wrote:
Hey, should I change all the tuples in code objects to be lists, too? A code object has got things like conames and coconsts. They're currently implemented as tuples, but they're just homogenous, variable-length sequences. 'course if people modified the lists, they'd caused Python to dump core.
I hope I read the correctly :-)
-- Marc-Andre Lemburg CEO eGenix.com Software GmbH
Company & Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/
- Previous message: [Python-Dev] Tuples vs. lists
- Next message: [Python-Dev] Tuples vs. lists
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]