Il 19/09/2013 12:56, Marco Mariani ha scritto:


> > Si potrebbe disquisire un po' sull'opportunit¢ di togliere
> > else/elif :)
>
> Perche'?

Perché trovo che return/return/return sia un pattern altrettanto leggibile e più conciso, ma era solo una battuta :)


Cioe' intendi cosi'?

def clamp(x, min, max):
if x < min: return min
if x > max: return max
return x
_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

Rispondere a