PEP 234 little bug?

Aahz Maruch aahz at panix.com
Sun Mar 3 23:34:12 EST 2002


In article <3C82A23F.84C66941 at earthlink.net>,
Hans Nowak  <wurmy at earthlink.net> wrote:
>
>Should it be? This may be a dumb question, but are there important
>reasons to do this, besides conformance with the PEP? I mean, the
>current situation does do the job; "for line in file" works. What
>would be the additional benefit of making a file its own
>iterator?

The following code would work correctly:

for line in file:
    if line == 'foo':
        break
for line in file:
    pass
-- 
                      --- Aahz  <*>  (Copyright 2002 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista

"How come we choose from just two people for President but more than 50
for Miss America?"  --AEN



More information about the Python-list mailing list