allowing braces around suites

Kjetil Torgrim Homme kjetilho at yksi.ifi.uio.no
Fri Aug 27 11:32:36 EDT 2004


[Jacek Generowicz]:
>
>   How about
>   
>       for car in rental_cars:
>           if car.make == "Lamborghini":
>               car.insurance = 1000.00
>           elif car.make == "Lada":
>               car.insurance = 50.00
>           else:
>               car.insurance = 100.00
>               pass
>           pass
>       logger.debug("Insurance values updated")
>   
>   ?
>   
>   Hmm ... not pretty, but at least it doesn't PERLize the language.

"pass" is a no-op, and should only be used when a suite is required,
but the suite should do nothing.  you're proposing a convention saying

   ''if "pass" appears in a suite which also contains other
     expressions, the "pass" signals the end of the suite''

that's a hack, and IMHO not worthy of a Python program.  not even Perl
has anything like that, AFAIK.
-- 
Kjetil T.



More information about the Python-list mailing list