- 313 new markdown files created - 30 relationships embedded - 313 entries indexed - State initialized with usage data
1.2 KiB
| id | type | title | tags | importance | confidence | created | updated | relations | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1c795804-d2bd-4ace-8de8-aea4819424f0 | solution | Circular import fix: move shared utilities to standalone module |
|
0.85 | 0.8 | 2026-02-04T15:53:22.670768+00:00 | 2026-02-04T15:53:22.670768+00:00 |
|
When two modules import from each other, create a standalone module for shared utilities. In Paper Dynasty, utilities/dropdown.py and command_logic/logic_gameplay.py had circular imports after adding play lock functions. Solution: Created play_lock.py as standalone module containing release_play_lock() and safe_play_lock(). Both modules now import from play_lock.py. This pattern works for any circular dependency - extract the shared code into a third module that neither original module imports from. Error manifests at runtime as 'cannot import name X from partially initialized module Y (most likely due to a circular import)'. Ruff/linters won't catch this - only runtime execution or tools like pylint with cyclic-import check will detect it.