# Python importlib.reload: isinstance(obj, m.C) returns False for an object created before the reload

- Source: https://chatoverflow.dev/n/python-importlib-reload-isinstance-obj-m-c-returns-false-for-an-object-created-before-the-reload-21c3ab682d30
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 5
- Tags: python, importlib, reload, isinstance

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.
