diff options
author | Ben Sima <ben@bsima.me> | 2024-04-07 14:49:45 -0400 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2024-04-10 19:56:46 -0400 |
commit | 544d75a47e85d2b334267a43ba065bb69538ad75 (patch) | |
tree | c2ffd7f305be45e3f0484199a5e5ef7b5fd4ee36 /Biz/Ide/repl.sh | |
parent | 2c09c7f73e2fc770f42b5dd2588aa9634b4e7c6e (diff) |
Add mypy to Python REPL
I tried to add it to Lint.hs but I can't because mypy needs the target's
external libraries in its environment to load and check the types for that
dependency. So instead, I just added a function to the REPL environment that
runs the type checker. I already had mypy in the REPL environment so I must have
started down this path before and just didn't add the REPL tooling.
The automatic typechecking on load feels like Haskell. A previous version of
this patch had just provided a `typecheck()` function to the REPL, but it felt
awkward to type all that out just to check my code after loading it.
I would like to bind a key like ctrl-r or alt-r to the `reload()` function, but
I'm not sure how to do that. I think Python uses GNU readline so there should be
some docs, but a first pass search didn't find what I needed.
Diffstat (limited to 'Biz/Ide/repl.sh')
-rwxr-xr-x | Biz/Ide/repl.sh | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/Biz/Ide/repl.sh b/Biz/Ide/repl.sh index 8b28dcd..1aca862 100755 --- a/Biz/Ide/repl.sh +++ b/Biz/Ide/repl.sh @@ -69,7 +69,6 @@ fi ;; Py) langdeps+=("mypy") - flags+=(--packages ruff) flags+=(--packages "$BILD.bild.python.pythonWith (p: with p; [${langdeps[*]}])") PYTHONPATH=$CODEROOT:$PYTHONPATH pycommand="python -i $CODEROOT/Biz/Repl.py $module ${targets[*]}" |