doucmentation bug or bug? p or q for numerical arrays

Terry Reedy tjreedy at udel.edu
Thu Jul 29 22:02:15 EDT 2004


"Peter Otten" <__peter__ at web.de> wrote in message
news:cea2mh$5u5$04$1 at news.t-online.com...
> Unlike '&', '|' and '~', the logical operators 'and' and 'or' cannot be
> overridden,

Which is because they are not actually operators in the strict sense (in
which 'a op b' is short for 'opfunc(a,b)').  Because of their
'short-circuiting' behavior, they are 'special forms' (in the Lisp sense)
that may not calculate b, whereas a function call always would.  The
so-called ternary op is also special and also can not be directly written
as a function for the same reason.

 Terry J. Reedy






More information about the Python-list mailing list