<div dir="ltr">So, this is kind of like Perl's "unless"?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 18, 2014 at 10:18 PM, Alexander Belopolsky <span dir="ltr"><<a href="mailto:ndarray@mac.com" target="_blank">ndarray@mac.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I would like to invite numpy community to weigh in on the idea that is getting momentum at</div><div>

<br></div><a href="https://mail.python.org/pipermail/python-ideas/2014-February/025437.html" target="_blank">https://mail.python.org/pipermail/python-ideas/2014-February/025437.html</a><br>
<div><br></div><div>The main motivation is to provide syntactic alternative to proliferation of default value options, so that</div><div><br></div><div>x = getattr(u, 'answer', 42)</div><div><br></div><div>can be written as</div>


<div><br></div><div>x = y.answer except ... 42</div><div><br></div><div>For a dictionary d,</div><div><br></div><div>x = d.get('answer', 42)</div><div><br></div><div>can be written as</div><div><br></div><div>x = d['answer'] except ... 42</div>


<div><br></div><div>For a list L,</div><div><br></div><div>try:</div><div>    x = L[i]</div><div>except IndexError:</div><div>    x= 42</div><div><br></div><div>can be written as</div><div><br></div><div>x = L[i] except ... 42</div>


<div><br></div><div><br></div><div>The ellipsis in the above stands for syntax being debated.</div><div><br></div><div>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.</div>


</div>
<br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br></div>