Re: need help on need help on generator...

From: Alex Martelli (aleaxit_at_yahoo.com)
Date: 01/22/05


Date: Sat, 22 Jan 2005 12:20:36 +0100

Craig Ringer <craig@postnewspapers.com.au> wrote:

> .>>> data = ''.join(x for x in infile)

Maybe ''.join(infile) is a better way to express this functionality?
Avoids 2.4 dependency and should be faster as well as more concise.

> Might it be worth providing a way to have file objects seek back to the
> current position of the iterator when read() etc are called? If not, I

It's certainly worth doing a patch and see what the python-dev crowd
thinks of it, I think; it might make it into 2.5.

> favour the suggestion in the referenced post - file should probably fail
> noisily, or at least emit a warning.

Under what conditions, exactly, would you want such an exception?

Alex



Relevant Pages

  • Re: Shell execute email
    ... email functionality and realized that no one had written ... includes a text file that shows the differences in file structure ... the winsock dependency, but you'd have to compile it yourself. ... If you want something really simple you might look into CDO, ...
    (microsoft.public.vb.general.discussion)
  • Re: Newbie - request for code comments
    ... "how concise or powerful is the language", ... Given all that built-in functionality, it could be a while before the OP ... to know his way around programming already.) ...
    (comp.lang.lisp)
  • Re: [patch 05/10] Text Edit Lock - Alternative code for i386 and x86_64
    ... That avoids the dependency on a patched ... The common code should be in a common function. ...
    (Linux-Kernel)
  • Re: winhttp and downloading a file
    ... WTH add a 20Mb dependency for functionality that's (at ... "This topic provides information about using the WinHTTP WinHttpRequest COM ...
    (microsoft.public.vb.general.discussion)
  • Re: winhttp and downloading a file
    ... WTH add a 20Mb dependency for functionality that's (at ... Winhttp.dll is a system component than can only be ... has Winhttp on it. ...
    (microsoft.public.vb.general.discussion)