<br><br><div><span class="gmail_quote">2008/4/18, Olivier Verdier <<a href="mailto:zelbier@gmail.com">zelbier@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I certainly didn't mean that "A==B" should return a boolean!!<br> <br> "A==B" should return an array of boolean as it does now. This is all right.<br> <br> *However* "bool(A==B)" should return a boolean, *not* raise an<br>
 exception. Why raise an exception? What is ambiguous about<br> "bool(A==B)"??<br> <br> This is what happens when you write "if A==B" because then<br> "bool(A==B)" is somehow triggered and bang, an exception is raised.<br>
 <br> As I tried to explain, the default behaviour should be that "bool(A)"<br> return "A.all()" but not an exception. Why is there an exception<br> raising at all?</blockquote></div><br>Sometimes, you want .all(), sometimes .any(). It really depends on the question you are asking. Even for bool(A), there is no easy answer. In some case I want True if some elements are true, in other cases only if all elements are true.<br>
I would agree with you some years ago, but after using bool(A) = A.all(), I started noticing that it brakes my coding instead of speeding it and does not give me any benefit at all.<br clear="all"><br>Matthieu<br>-- <br>French PhD student<br>
Website : <a href="http://matthieu-brucher.developpez.com/">http://matthieu-brucher.developpez.com/</a><br>Blogs : <a href="http://matt.eifelle.com">http://matt.eifelle.com</a> and <a href="http://blog.developpez.com/?blog=92">http://blog.developpez.com/?blog=92</a><br>
LinkedIn : <a href="http://www.linkedin.com/in/matthieubrucher">http://www.linkedin.com/in/matthieubrucher</a>