On Sat, 16 Jul 2011 19:14:47 +1000, Chris Angelico wrote:

> Only thing I can think of is:
> 
> import math
> math.sqrt=lambda(x) x.__sqrt__(x) if x.whatever else math.sqrt(x)

math.sqrt=(lambda sqrt=math.sqrt: lambda x: x.__sqrt__(x) if 
hasattr(x,'__sqrt__') else sqrt(x))()

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to