From: Eric F. <ef...@ha...> - 2006-10-11 22:47:03
|
Charles R Harris wrote: [...] > b) extending 'and' and 'or' to allow element-by-element logical > operations or adding && and || > > 2) Lowering the precedence of & so that a > 8 & a < 10 works as you > would expect. > > > Yes on the extra operators. No on changing the precedence of &, that > would just confuse the heck out of all us c/c++ programmers; && and || > would be good. Travis's suggestion 2 is consistent with c/c++, where precedence increases from logical to bitwise to relational. (e.g., http://www.cs.niu.edu/~duffin/csci241/precedence.html). Python precedence now increases from logical to relational to bitwise, so it is inconsistent with c/c++. (http://docs.python.org/ref/summary.html#l2h-456) Eric |