On 1/24/08, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> [John Barham]
> > But getting back to the original issue, what does using
> > frozensets gain you over using a tuple:
> >
> > if urlext in ('html', 'xml', 'php'):
>
> With sets, the search is O(1).
> With tuples, it is O(n).
> Sets win on inputs longer than 1.

I thought you tried changing those tuples to frozensets (because it
was semantically better), and found that it didn't actually win for
tuples of length 2 or 3.

-jJ
_______________________________________________
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

Reply via email to