This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Gabriele Tornetta
Recipients Gabriele Tornetta, bup, ethan.furman, paul.moore, r.david.murray, steven.daprano
Date 2021-12-10.00:03:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1639094595.1.0.361239052716.issue32683@roundup.psfhosted.org>
In-reply-to
Content
> Python is very much a language about responsibility.  If Django is overriding `__getattribute__` then it is their responsibility to ensure that everything still works properly.

Perhaps I didn't stress observability enough. A tool like a tracer or a profiler, in the ideal world, is not supposed to perturb the tracee in any way. The current implementation of isinstance, when used by an observability tool, may cause side effects as well as overheads, so it is not safe to use in such tools. Working around it may solve the side-effects issue, but leaves the problem of overheads. Changing the way isinstance works internally might prove beneficial for such tools.

En passant,  I think it should be noted that the built-in "type" doesn't suffer from the same problem, i.e.

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


type(Side())
~~~

works as expected.
History
Date User Action Args
2021-12-10 00:03:15Gabriele Tornettasetrecipients: + Gabriele Tornetta, paul.moore, steven.daprano, r.david.murray, ethan.furman, bup
2021-12-10 00:03:15Gabriele Tornettasetmessageid: <1639094595.1.0.361239052716.issue32683@roundup.psfhosted.org>
2021-12-10 00:03:15Gabriele Tornettalinkissue32683 messages
2021-12-10 00:03:14Gabriele Tornettacreate