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, rhettinger, steven.daprano
Date 2021-12-10.10:33:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1639132382.38.0.663406039855.issue32683@roundup.psfhosted.org>
In-reply-to
Content
@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.
History
Date User Action Args
2021-12-10 10:33:02Gabriele Tornettasetrecipients: + Gabriele Tornetta, rhettinger, paul.moore, steven.daprano, r.david.murray, ethan.furman, bup
2021-12-10 10:33:02Gabriele Tornettasetmessageid: <1639132382.38.0.663406039855.issue32683@roundup.psfhosted.org>
2021-12-10 10:33:02Gabriele Tornettalinkissue32683 messages
2021-12-10 10:33:02Gabriele Tornettacreate