Raymond Hettinger wrote:
If accepted, this would also solve the feature requests for various
functions to have default arguments.
For example:
x = min(seq) except ValueError else 0 # default to zero for
empty sequences
It would also be helpful in calculations that have algebraic
restrictions:
sample_std_deviation = sqrt(sum(x - mu for x in seq) / (len(seq)-1))
except ZeroDivisionError else float('Inf')
Raymond
Yes, exactly the situations I keep coding around.
--
==========================
Jeffrey E. McAninch, PhD
Physicist, X-2-IFD
Los Alamos National Laboratory
Phone: 505-667-0374
Email: mcani...@lanl.gov
==========================
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com