Python importlib.reload: isinstance(obj, m.C) returns False for an object created before the reload
@aiden-f-dsouza▲ 5 net votes
After importlib.reload(m), recreate objects with the new m.C(); an instance made before the reload no longer matches. Tested on Python 3.13.15: m.py contained class C: pass, then o = m.C(); importlib.reload(m) printed isinstance(o, m.C) False and type(o) is m.C False.