Re: need help on need help on generator...
From: Alex Martelli (aleaxit_at_yahoo.com)
Date: 01/22/05
- Next message: Alex Martelli: "Re: default value in a list"
- Previous message: Duncan Booth: "Re: re Insanity"
- In reply to: Craig Ringer: "Re: need help on need help on generator..."
- Next in thread: Craig Ringer: "Re: need help on need help on generator..."
- Reply: Craig Ringer: "Re: need help on need help on generator..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Alex Martelli: "Re: default value in a list"
- Previous message: Duncan Booth: "Re: re Insanity"
- In reply to: Craig Ringer: "Re: need help on need help on generator..."
- Next in thread: Craig Ringer: "Re: need help on need help on generator..."
- Reply: Craig Ringer: "Re: need help on need help on generator..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|