Re: Good code patterns in Python
by Jiri Barton other posts by this author
Jul 1 2003 4:38PM messages near this date
Re: Good code patterns in Python
|
Re: Good code patterns in Python
One, there has been a proposal for a ternary operator on python.org. You
know that kind of (cond) ? (eval1) : (eval2) stuff.
Two, no need to guard that code. Passing and assigning a paramater should
always make you THINK about what's happening.
Three, how about
a = 1
b = 0
.....
if b == 0:
a = 0
else:
a = a/b
? You cannot replace it with your pattern. Sure enough, there are far more
examples of this -- when you cannot evaluate the first expression.
Jiri Barton
--
http://mail.python.org/mailman/listinfo/python-list
Thread:
Will Stuyvesant
Ben Finney
Erik Max Francis
Bernhard Herzog
holger krekel
Kirk Job-Sluder
Erik Max Francis
Dennis Lee Bieber
Jiri Barton
Lulu of the Lotus-Eaters
Terry Reedy
Steven Taschuk
Michele Simionato
|