[pythran] or & and operators

  • From: serge Guelton <serge.guelton@xxxxxxxxxxxxxxxx>
  • To: pythran@xxxxxxxxxxxxx
  • Date: Mon, 29 Oct 2012 16:43:56 +0100

Hi there,

Following this post

        
//www.freelists.org/post/nuitka-dev/Nuitka-0325pre4-reformulated-or-and-and

I realized that pythran does not support the `or' and `and' operators
the way python does. Not a big deal as we can use intrisic to simulate
their behavior and use something like 

        a or b -> (a?a:b)

instead.

An optimization could be to detect that

        (a or b)

is only used for a test, and thus we could generate

        a || b

instead of the more expensive python test. Looks a lot like the on-going
work around range/xrange !

-- 
serge

Other related posts:

  • » [pythran] or & and operators - serge Guelton