A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-May/079791.html below:

Including a new-style proxy base class in 2.6/3.0

[Python-Dev] Issue 643841: Including a new-style proxy base class in 2.6/3.0 [Python-Dev] Issue 643841: Including a new-style proxy base class in 2.6/3.0Armin Ronacher armin.ronacher at active-4.com
Tue May 27 14:18:39 CEST 2008
Hi,

Nick Coghlan <ncoghlan <at> gmail.com> writes:

> What version are you using, and are your proxies correctly implementing 
> all the __r*__ versions of the methods?
The link to the ugly proxy is in the mail :-)  And no, I'm currently not
providing any __r*__ methods as I was too lazy to test on each call if the
method that is proxied is providing an __rsomething__ or not, and if not come up
with an ad-hoc implementation by calling __something__ and reversing the
arguments passed.

> While there are still some cases where types in the standard library 
> raise TypeError directly instead of returning NotImplemented, they're 
> generally pretty good about playing well with others (see the 
> test_typetools.py file attached to the tracker item for #643841)
I also think that the stdlib should mention NotImplemented with a big warning. 
I see countless classes raising TypeError()s if __add__ or something fails which
seem to work alright as long as someone tries to __radd__ it.

Regards,
Armin

More information about the Python-Dev mailing list

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