A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-April/023432.html below:

[Python-Dev] Problems with new-style classes and coercion

[Python-Dev] Problems with new-style classes and coercion [Python-Dev] Problems with new-style classes and coercionDavid Abrahams David Abrahams" <david.abrahams@rcn.com
Mon, 22 Apr 2002 13:44:21 -0500
----- Original Message -----
From: "Guido van Rossum" <guido@python.org>

> New-style classes don't support __coerce__.  It's a long and sad
> story, but basically __coerce__ was a mistake, and I've stopped
> supporting it for new-style classes.

That is actually a huge relief, as far as I'm concerned. Boost.Python's
overloading support should handle heterogeneous operator arguments quite
nicely without any intervening __coerce__.

> This means that the + operator
> doesn't call __coerce__.  For some reason, coerce() still calls it;
> maybe that was a mistake.

Maybe; maybe not. Maybe it would be a good idea to issue a warning when
a new-style class defines __coerce__.

BTW, thanks to everyone for pointing out my version mismatch problem. I
have installed and tested against 2.2.1, but needed to update my paths
to invoke it from the command-line.

-Dave





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4