[Python-iterators] Re: PEP 234: Iterators
Tim Peters
tim.one at home.com
Wed May 2 00:29:52 EDT 2001
[Thomas Bellman]
> ...
> My program was to download a set of web pages, indexed by a date
> in the URL. The next() method in the iterator generated the URL
> for the next day, and I didn't want it to start trying to download
> 2000 years worth of web pages... Thus I would do:
>
> ui = iter(obj)
> ui.set_start(2000,4,23)
> ui.set_end(2000,5,29)
> for url in ui:
> urlopen.urlretrieve(url)
Oh dear. *Another* year 2**31 problem waiting to bite us! I hope Python
3*10L**10 will eradicate the visible distinction between ints and longs by
then.
can't-be-in-favor-of-iterators-if-they-encourage-ints-ly y'rs - tim
More information about the Python-list
mailing list