Overloading assignment operator

Achim Domma domma at procoders.net
Tue Jan 23 17:45:25 EST 2007


Paul McGuire wrote:

> Simple option: how do you feel about using '<<=' instead of '=' (by
> defining __ilshift__)?  This gives you:
> 
> A <<= B * C
> 
> (looks sort of like "injecting" the result of B times C into A)

Thanks! That is exactly the kind of solution I was looking for! :-)

Achim



More information about the Python-list mailing list