[Python-Dev] 'hasattr' is broken by design

Benjamin Peterson benjamin at python.org
Tue Aug 24 00:17:16 CEST 2010


2010/8/23 Yury Selivanov <yselivanov at gmail.com>:
>> On 2010-08-23, at 6:00 PM, Guido van Rossum wrote:
>> On Mon, Aug 23, 2010 at 2:22 PM, Yury Selivanov <yselivanov at gmail.com> wrote:
> BTW, is it possible to add new magic method __hasattr__?  Maybe not
> in Python 3.2, but in general.

-1 The whole point of hasattr() is that getattr() on that attribute
would return something. Let's not destroy that.

-- 
Regards,
Benjamin


More information about the Python-Dev mailing list