Re: Question about overloading of binary operators
On Mar 31, 5:03 pm, gigs <[EMAIL PROTECTED]> wrote: > Raj Bandyopadhyay wrote: > > Hi > > > Here's a simple class example I've defined > > > # > > class myInt(int): > >def __add__(self,other): > > return 0 > > > print 5 + myInt(4) #prints 9 > > print myInt(4)
Re: Question about overloading of binary operators
Raj Bandyopadhyay wrote: > Hi > > Here's a simple class example I've defined > > # > class myInt(int): >def __add__(self,other): > return 0 > > print 5 + myInt(4) #prints 9 > print myInt(4) + 5 #prints 0 > # > > The Python bi