I think raising a type error when using `&` with Number is a good idea; I
assume that And(2, 3) works.


On Mon, Nov 4, 2013 at 11:38 AM, Aaron Meurer <notifications@github.com>wrote:

> In sympy/logic/boolalg.py:
>
> > @@ -81,14 +225,14 @@ class And(LatticeOp, BooleanFunction):
> >      Notes
> >      =====
> >
> > -    The operator operator ``&`` will perform bitwise operations
> > -    on integers and for convenience will construct an Add when
> > -    the arguments are symbolic, but the And function does not
> > -    perform bitwise operations and when any argument is True it
> > -    is simply removed from the arguments:
> > +    The ``&`` operator is provided as a convenience, but note that its use
> > +    here is different from its normal use in Python, which is bitwise
> > +    and. Hence, ``And(a, b)`` and ``a & b`` will return different things if
> > +    ``a`` and ``b`` are integers.
>
> It currently raises TypeError. I'm not sure what it should do. I'm
> somewhat of the opinion that supporting numbers other than 0 and 1 in the
> logic system could cause too much confusion against bitwise operations.
> Personally, supporting any numbers seems unnecessary, though I can see the
> value given that True == 1 and False == 0 in Python.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/sympy/sympy/pull/2560/files#r7406927>
> .
>