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/2000-December/010895.html below:

[Python-Dev] PEP 231, __findattr__()

[Python-Dev] PEP 231, __findattr__()Finn Bock bckfnn@worldonline.dk
Tue, 05 Dec 2000 15:40:10 GMT
On Tue, 05 Dec 2000 07:54:20 -0500, you wrote:

>>     GvR> What does Jython do here?
>> 
>> It's not exactly equivalent, because Jython's __findattr__ can't call
>> back into Python.
>
>I'd say that Jython's __findattr__ is an entirely different beast than
>what we have here.  Its min purpose in life appears to be to be a
>getattr equivalent that returns NULL instead of raising an exception
>when the attribute isn't found -- which is reasonable because from
>within Java, testing for null is much cheaper than checking for an
>exception, and you often need to look whether a given attribute exists
>do some default action if not. 

Correct. It is also the method to override when making a new builtin
type and it will be called on such a type subclass regardless of the
presence of any __getattr__ hook and __dict__ content. So I think it
have some of the properties which Barry wants.


regards,
finn



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