[Python-Dev] deque alternative
"Martin v. Löwis"
martin at v.loewis.de
Wed Dec 28 11:55:31 CET 2005
Tim Peters wrote:
> You seem to be ignoring possiblities for sharing across lists, and
> such sharing is natural in many graph algorithms.
No doubt cons cells are a useful construct. I think Martin Blais
(and others) advocated a plain list container type, only implemented
as a linked list, instead of a as a vector. The subject is
"deque alternative", after all.
Typically, you either have sharing, or you have appending, but not
both. If sharing is what you want, 2-tuples (pairs) provide an
adequate API (IMO). If you want a deque alternative, sharing won't
happen.
Regards,
Martin
More information about the Python-Dev
mailing list