On Tue, Apr 29, 2008 at 4:30 PM, Alexander Belopolsky < [EMAIL PROTECTED]> wrote:
> I would say that if it is possible that n exceeds a few hundred > million, it is a good idea to pause and think whether you want to have > this loop implemented in Python to begin with. > Maybe. But the answer is often going to be yes, if it's a choice between me spending some number of hours translating everything to C, or just leaving my computer do the work (however inefficiently) while I do something else. These numbers aren't ridiculously large. I just tried for i in range(2**31): pass on my (32-bit) laptop: it took 736.8 seconds, or about 12 and a bit minutes. (An aside: in contrast, for i in range(2**31-1): pass took only 131.1 seconds; looks like there's some potential for optimization here....) Put another way: range(n) currently works, in Py3k, for n > sys.maxsize. What's the rationale for breaking that? extention (combined with a 64-bit OS) may be a good idea if you > routinely iterate over huge datasets. > Well, huge datasets (large time *and* space requirements) don't really come into it for my typical use-cases: just long-running processes. Mark
_______________________________________________ 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