What is up with "=="?

Mel Wilson mwilson at the-wire.com
Fri Oct 10 11:14:14 EDT 2003


In article <bm4u7q$74g$0 at 216.39.172.122>, bokr at oz.net (Bengt Richter) wrote:
> coerce(...)
>     coerce(x, y) -> None or (x1, y1)
>
>     When x and y can be coerced to values of the same type, return a tuple
>     containing the coerced values.  When they can't be coerced, return None.
>
> >>> coerce(2,'2')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: number coercion failed
>
>Bad doc string or misimplementation? Or is it fixed in the latest release, (which I
>haven't gotten around to installing yet)?

Otherwise, wouldn't it imply that 2+'3' came out to 5 or '23'?

        Regards.        Mel.




More information about the Python-list mailing list