[TIP] weirdity with identity of Mock

Chris Withers chris at simplistix.co.uk
Fri Jan 27 00:00:10 PST 2012

On 26/01/2012 13:01, Michael Foord wrote:
> To make int(x) work you *normally* have to attach an __int__ method to
> type(x) - which affects all instances. You can't attach magic methods to
> instances (barring a few bugs in Python itself - mostly all fixed in
> Python 2.7).

Yeah yeah, I want my cake *and* I want to eat it...
...and I want a beer too!



Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk

More information about the testing-in-python mailing list