I would like to invite numpy community to weigh in on the idea that is
getting momentum at

https://mail.python.org/pipermail/python-ideas/2014-February/025437.html

The main motivation is to provide syntactic alternative to proliferation of
default value options, so that

x = getattr(u, 'answer', 42)

can be written as

x = y.answer except ... 42

For a dictionary d,

x = d.get('answer', 42)

can be written as

x = d['answer'] except ... 42

For a list L,

try:
    x = L[i]
except IndexError:
    x= 42

can be written as

x = L[i] except ... 42


The ellipsis in the above stands for syntax being debated.

Effectively, Python is about to gain support for a new operator and
operators are very precious for numpy.  So, I think numpy community has a
horse in that race.
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to