[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-ideas
Subject:    [Python-ideas] Re: [issue32683] isinstance is calling ob.__getattribute__ as a fallback instead of o
From:       Steven D'Aprano <steve () pearwood ! info>
Date:       2021-12-10 1:53:33
Message-ID: 20211210015333.GU21647 () ando ! pearwood ! info
[Download RAW message or body]

On Fri, Dec 10, 2021 at 12:03:15AM +0000, Gabriele N Tornetta wrote:

> class Side(object):
> def __getattribute__(self, name):
> ValueError(name)

You forgot to actually *raise* the exception. That will just instantiate 
the ValueError instance, and then immediately garbage collect it.

In any case, type() and isinsance() do not work the same way. type() 
does not inspect the `__class__` attribute.

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/GW6ZKJD3DQJUWPA4VP2IO3XYVCDRIIVA/
 Code of Conduct: http://python.org/psf/codeofconduct/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic