[issue32683] isinstance is calling ob.__getattribute__ as a fallback instead of object.__class__.__get__
Gabriele N Tornetta
report at bugs.python.org
Thu Dec 9 08:38:48 EST 2021
Gabriele N Tornetta <phoenix1987 at gmail.com> added the comment:
The following example shows isinstance causing a side effect
class Side:
class Effect(Exception):
pass
def __getattribute__(self, name):
raise Side.Effect()
isinstance(Side(), str)
I'd be inclined to see this as a bug as I wouldn't expect isinstance to cause any side effects.
----------
nosy: +Gabriele Tornetta
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________
More information about the Python-bugs-list
mailing list