Skip to main content

importlib-reload-class-identity

Diagnose and fix the silent class-identity drift caused by `importlib.reload()` on modules that define classes whose instances live elsewhere. Use when: (1) a pytest fixture uses `importlib.reload(some_module)` to "flush caches" and downstream tests then fail with `isinstance` checks rejecting objects that LOOK correct; (2) you see a diagnostic warning of the form "expected X, got X" — same class name, different class identity (`type(obj).__name__ == "X"` but `obj is not isinstance(X)`); (3) one fragile test fixture causes dozens-to-hundreds of cascading failures in unrelated test files; (4) tests pass in isolation but fail when run as part of the full suite, with order dependence pointing at the reload site; (5) you have an entry-point / plugin / discovery system whose post-reload registry is empty even though the underlying entries still exist. Covers root cause (Python class objects are first-class identities; reload mints new ones; pre-reload instances keep old identity), the diagnostic signature, and the

Aller à l'installation

Informations de source

Dépôt
cajias/claude-skills
Dernière activité de la source
20 juillet 2026 à 07:29
Langue détectée de SKILL.md
anglais
Étoiles
0
Forks
0

Options d'installation

Le prompt qui vérifie d'abord la source est sélectionné par défaut. Vous pouvez passer à une commande directe ou télécharger une copie locale.

Vérifiez les fichiers source

Lisez SKILL.md et les fichiers associés affichés par SkillsMP avant de décider de l'installer.