On Sat, Apr 26, 2008 at 1:49 PM, Facundo Batista <[EMAIL PROTECTED]> wrote: > Which should the range() definition be, in your words?
"A set of integers from start to stop skipping step." [ ... ] > At this moment I stopped writing this mail, and I went to code a > Range() class to have the semantics that we're seeking here (it's > attached), and I couldn't finish it 100% because of a len() behaviour > that I'm including here, because it's related to what we're discussing > here: > > >>> class C: > ... def __len__(self): > ... return 100000000000000000000000000000 > ... > >>> c = C() > >>> len(c) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > OverflowError: Python int too large to convert to C ssize_t > > >From an external point of view, and knowing that ints are unbound, why > should I have an error here? lens are forced to be <= Py_ssize_t because that's the limit put on sequence sizes. -- Cheers, Benjamin Peterson _______________________________________________ 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