Status of PEPs?

Heather Coppersmith me at privacy.net
Fri Jul 2 09:06:07 EDT 2004


On 02 Jul 2004 15:37:30 +0300,
Ville Vainio <ville at spammers.com> wrote:

> while 1:
>   a = getobject()
>   if a is None:
>     break                # flag doesn't work, you'd need to do "continue"
>   process(a)
>   morestuff(a)

    keep_trying = True
    while keep_trying:
        a = getobject( )
        if a:
            process( a )
            morestuff( a )
        else:
            keep_trying = False

Or:

    a = getobject( )
    while a:
        process( a )
        morestuff( a )
        a = getobject( )

although some people dislike the redundancy more than the extra flag or
the break statement.

OTOH, these arguments have all been had before.  Google for things like
"loop and a half."

Regards,
Heather

-- 
Heather Coppersmith
That's not right; that's not even wrong. -- Wolfgang Pauli



More information about the Python-list mailing list