Re: [sage-devel] arithmetic with True and False

2010-07-24 Thread David Kirkby
On 24 July 2010 22:29, Burcin Erocal wrote: > Hi, > > At Sage Days 24, I learned that Python allows the user to do arithmetic > with bools: > > In [1]: 5+True > Out[1]: 6 I personally don't see anything wrong with that - True has long since been defined as 1 in most languages, and False as 0. I

Re: [sage-devel] arithmetic with True and False

2010-07-24 Thread Robert Bradshaw
On Sat, Jul 24, 2010 at 2:29 PM, Burcin Erocal wrote: > Hi, > > At Sage Days 24, I learned that Python allows the user to do arithmetic > with bools: > > In [1]: 5+True > Out[1]: 6 > > In [2]: True + False > Out[2]: 1 > > In [3]: 5+False > Out[3]: 5 > > Sage seems to follow this convention as well

Re: [sage-devel] arithmetic with True and False

2010-07-24 Thread Carl Witty
On Sat, Jul 24, 2010 at 2:29 PM, Burcin Erocal wrote: > Hi, > > At Sage Days 24, I learned that Python allows the user to do arithmetic > with bools: > > In [1]: 5+True > Out[1]: 6 > > In [2]: True + False > Out[2]: 1 > > In [3]: 5+False > Out[3]: 5 > > Sage seems to follow this convention as well