[Tutor] RE: __and__

Joseph J. Strout joe@strout.net
Mon, 18 Oct 1999 11:11:20 -0700


At 6:56 PM +0100 10/18/99, Arne Mueller wrote:

>Yes, but how can you modify the bitwise operator '&' ?

By overriding __and__.

> As mentioned in
>some of the emails before changeing '&' would have an effect on
>'__and__' as well, wouldn't it?

'&' and '__and__' are the same function -- one is an operator, and 
one is a method, and they are One.  It's exactly analogous to '+' and 
'__add__'.

	operator	method		operation
	--------	------		---------
	+		__add__		addition
	&		__and__		bitwise and

Cheers,
-- Joe

,------------------------------------------------------------------.
|    Joseph J. Strout           Biocomputing -- The Salk Institute |
|    joe@strout.net             http://www.strout.net              |
`------------------------------------------------------------------'