append to non-existing list

Mike Meyer mwm at mired.org
Wed Nov 9 15:53:08 EST 2005


"Fredrik Lundh" <fredrik at pythonware.com> 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 <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list