Shouldn't urlopen "files" be iterable?

Magnus Lie Hetland mlh at idi.ntnu.no
Sat Sep 29 23:22:49 CEST 2001


"Grant Edwards" <grante at visi.com> wrote in message
news:slrn9rcdao.1al.grante at tuxtop.visi.com...
> On Sat, 29 Sep 2001 22:54:53 +0400, Oleg Broytmann <phd at phd.pp.ru> wrote:
>
> >> How do you request part of a file via HTTP?
> >
> >   Using ranges.
>
[snip]

> It's going to be pretty hard to determine whether it "cheaper"
> to download the whole thing and discard unwanted portions or to
> establish multiple conenctions and send multiple requests.

Certainly. I guess my main motivation for wanting to use
file iteration is an aesthetic one... I like it. And I certainly
like "file-like" objects to _behave like_ files. Isn't that what
they're supposed to do?

Again, I see no reason not to include this. (If need be, I'll be
happy to provide a patch.)

> --
> Grant Edwards

I'm-sure-there-are-other-"faulty"-file-like-objects-in-there'ly
yours, Magnus

--

  Magnus Lie Hetland         http://www.hetland.org

 "Reality is that which, when you stop believing in
  it, doesn't go away."           -- Philip K. Dick






More information about the Python-list mailing list