You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypedPython: run the type gate when a module is imported (development mode) #183
(b) New: in development mode (notebook cells, hot reload, a debug app run), importing a project module runs the same gate (N-7) on it first; a type error stops the import with an error that lists the diagnostics. Release builds rely on (a) and skip it. Results are cached by file content hash so an unchanged module is not re-checked.
Not done: per-call runtime argument checks, because compiled and interpreted code must behave exactly as CPython does.
Completion: SPEC N-7 entry for (b); a test that imports a module with a type error in development mode and gets the error before any of its code runs (red first), and that the same module imports in release mode; a cache hit test.
Form: an import hook (meta path finder) installed only in development mode. It checks modules under the project source roots, and a type error raises an ImportError carrying the diagnostics. It is not installed in release builds.
Known cost: the first import of a module pays one gate run, a few hundred ms (Pyrefly's fixed cost). Later imports of unchanged files hit the hash cache. Reducing that first-import delay is tracked together with TypedPython gate: cut the type-report overhead #21.
Activity
b-re-w commentedon Oct 3, 2026
Agreed plan (leader, 2026-10-04):
python -m typedpython check, file-hash cache and diagnostic format.b-re-w commentedon Oct 17, 2026
Landed in develop via the import-gate PR. Follow-ups: on-disk cache, startup wiring.