critique this little script, if you like
arv.nntp at gmail.com
Mon May 1 12:27:33 CEST 2006
John Salerno escribió:
> 2. Between the if block or the try block, which is more Pythonic?
Since the command line argument is optional I don't think it should be
considered and exceptional condition if it's missing, so the "if" block
looks better to me. No idea if this is more pythonic.
> try block seems nicer because it doesn't have such an ugly-looking check
> to make.
Ok, so you should do:
x = 1/i
except ZeroDivisionError :
if (i == 0) :
More information about the Python-list