readline in while loop

Andrew Walkingshaw andrew-usenet at lexical.org.uk
Fri May 23 09:28:20 EDT 2003


In article <87znldn8h3.fsf at titan.staselog.com>, Edvard Majakari wrote:
> Looks neat. I try to avoid Perl vs. Python flame fest, but are some
> constructs in Python context-sensitive (like in Perl), or is this some
> handy use of iterators in class file?
> 

Only answering the second half of your question, the latter - I think
this is a python-2.2ism, but file objects have grown an iterator which
behaves as above. It's an entirely general mechanism, not a bit of
special-casing.

- Andrew 

-- 
Andrew Walkingshaw | andrew-usenet at lexical.org.uk





More information about the Python-list mailing list