On Fri, May 20, 2011 at 10:36 AM, Chris Kaynor <ckay...@zindagigames.com> wrote: > I think the question was: can this dummy code ever produce a set containing > less then itemCount items (for 0 < itemCount < 2**32)?
In CPython, no. Even when you get a hash collision, the code checks to see whether the hashes are actually equal before it calls the rich comparison, the former check being a much faster operation since the hash values are cached. I'm not sure whether this can be counted on for all Python implementations, though. -- http://mail.python.org/mailman/listinfo/python-list