Gabriele N Tornetta <phoenix1...@gmail.com> added the comment:

@rhettinger
Apologies. You're totally right but I wasn't expecting this to become a lengthy 
conversation.

So, to get closer to the initial issue, I believe that this ticket could be 
closed provided that the documentation is improved by making developers aware 
of the potential side effects of isinstance. I was doing some more experiments 
and it looks like

def _isinstance(obj, classinfo):
    return issubclass(type(obj), classinfo)

might be considered a "side-effects-free" version of isinstance. So perhaps one 
thing to mention in the documentation is that `isinstance(obj, classinfo) != 
issubclass(type(obj), classinfo)` in general.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to