If
I could change history, I would not have changed Leo's API when I did. First, I should have made only the changes required to satisfy
mypy. Larger changes to Leo's API should have come only after the
annotation work was complete. Otoh, changing the API early simplified
the annotation work.
Anyway, I'll attempt to make future PRs as small and focused as possible.
Use the walrus operator
I have come to love the := operator. A Leonine script will change:
x = whatever
if x:
...
to:
if x := whatever:
...
This more concise code sometimes helps mypy and other checkers.
Add annotations gradually, without modifying Leo's API
Three separate PRs will require strict annotations in:
- The remaining files in leo/core.
- all files in leo/commands.
- All of Leo's qt gui files.
These PRs will modify Leo's API only if absolutely necessary.
Summary
Future PRs should be smaller, simpler, saner, and safer.
I work on these PRs only after merging the backlog of pending PRs.
Edward