List containing objects and subclassing...

Shagshag13 shagshag13 at
Wed Jun 5 17:58:36 CEST 2002


I need an advice, i have a python list containing only object "node", and i'm wondering if this
is best to hold it in a python list (as by now) or if i should write a "nodes" object subclassing from
list and implementing some other methods i need to process on node object (contained by this list)
and that i do now from "outside", or if i should write my own container implementing __getitem__
(i also have done that in another version)...

[hash_i] --> [node_j] -> [node_k]...

Which way is better OO practice ? which is the efficient one ?
What are the pros and cons (maybe best oo vs efficient ?) ?



More information about the Python-list mailing list