"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> Float doesn't handle implicit conversion to anything but but builtin types. >> In particular, it doesn't check to see if the object beinng added has a >> __float__ method, and invoke that to do the conversion if it does. > > that's because __float__ is there to let you control what float() does, > not to get automatic type conversion for mixed operations.
So is there a mechanism to indicate to the builtin types how they should coerce some user-defined class into themselves? <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list