Message408188
@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. |
|
Date |
User |
Action |
Args |
2021-12-10 10:33:02 | Gabriele Tornetta | set | recipients:
+ Gabriele Tornetta, rhettinger, paul.moore, steven.daprano, r.david.murray, ethan.furman, bup |
2021-12-10 10:33:02 | Gabriele Tornetta | set | messageid: <1639132382.38.0.663406039855.issue32683@roundup.psfhosted.org> |
2021-12-10 10:33:02 | Gabriele Tornetta | link | issue32683 messages |
2021-12-10 10:33:02 | Gabriele Tornetta | create | |
|