Steven D'Aprano wrote:
The first question to ask is why are you using an array to hold multipleOn Fri, 04 May 2007 07:55:25 -0700, Alex Martelli wrote: unidentified objects? Why not use a dictionary instead. You could add items using the object as key and type as data element. import typesThen you can iterate over the dictionary; selection/action by type. The question seems kind of bogus anyway. The only language feature that stores different elements in a single body are similar to 'C/C++' structures. At which point one has to ask... why not use the struct module? Ah ... perhaps the questioner didn't know about them? Well I'd suggest, before more 'annoyances' postings to review the top level of the module index @ http://docs.python.org/modindex.html. I find it a great place to start looking for python language features that my programs need, but I don't know, yet. sph -- HEX: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 |
-- http://mail.python.org/mailman/listinfo/python-list
