On Tue, Sep 2, 2008 at 3:53 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> The only time when __len__ can be larger than sys.maxsize is when the > class implements some kind of virtual space where the values are > computed on the fly. In such cases trying to walk over all values is > bound to take forever, and the length is likely not of all that much > interest to the caller -- but sometimes we may need to pass such an > object to some library code we didn't write that is making some > trivial use of len(), like the examples I gave before. len() is useful for more than iteration, such as setting the bounds for a binary search (e.g., over a large on-disk data structure) That said, I would actually be okay with the status quo (which does > raise an OverflowError) as long as we commit to fixing this properly > in 2.7 / 3.1, by removing the range restriction (like we've done for > other int operations a long time ago). > +1 -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com>
_______________________________________________ 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