Le mercredi 26 avril 2006 à 11:38 -0400, Jim Jewett a écrit : > (2) How to make set usage at least as efficient. > (3) Whether the tradeoffs are worth it.
Well, testing for inclusion in a container of 3 ints may not be significant vs. all the overhead of the interpreter and vs. what you are actually doing inbetween the inclusion tests. That's why I said "*significantly* more efficient" : I think both 3-int lists and 3-int sets are fast enough, aren't they ? > Making it as efficient would require changes under the cover. For > example, sets small enough to fit in smalltable might use a linear > scan and not bother with hashing. This optimization is sane with set literals built out of constants for which you know the comparison is fast. But searching for an element without hashing may also involve costly __eq__ calls. Or am I mistaken ? _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com