[Python-Dev] PEP 326 (quick location possibility)

Skip Montanaro skip at pobox.com
Thu Jan 29 20:26:06 EST 2004


    >> >         if global_min is None or score(candidate) < global_min:
    >> >             global_min = score(candidate)
    >> >             do stuff appropriate for a new local minimum

    >> That's precisely what I was suggesting, yes.

    Andrew> The code is still brittle.  If score(candidate) returns None,
    Andrew> hilarity ensues.

Presumably the return value of score() is under control of the author of the
loop who can guarantee that it won't return None.

Skip



More information about the Python-Dev mailing list