On Sunday, June 28, 2026 at 8:26:14 PM UTC-5 Edward K. Ream wrote:
PR
#4755 is ready for review!
Review is going well. Many thanks to Félix. The PR remains a draft while I fix more and more annotations.
Afterwards, I'll create three more PRs that improve annotations:
- The first will require mypy's strict_optional setting for the rest of the files in leo/core.
- The second will do the same for the files in leo/commands.
- The third will cover Leo's Qt gui files.
This is still the plan.
However, mypy's --follow-imports=normal option reveals annotation problems outside of the six core files that PR #4755 is supposedly checking.
Yes, the PR could ignore those errors, but why do that? The PR should follow mypy errors wherever they lead!
It looks like the PR will eventually fix 400+ mypy complaints to resolve, in at least the following files:
leo/plugins/mod_scripting.py,
leo/plugins/qt_commands.py,
leo/plugins/qt_frame.py,
leo/plugins/qt_gui.py,
leo/plugins/qt_idle_time.py,
leo/plugins/qt_layout.py,
leo/plugins/qt_text.py,
leo/plugins/qt_tree.py,
leo/plugins/viewrendered.py,
leo/plugins/viewrendered3.py.
These additional diffs are the result of the annotations made in the original six files.
Crucially, fixing these "outside" complaints can sometimes reveal other problems in the original six files! That is, it's virtually impossible to predict how changes to annotations will cascade.
Summary
Imo, nothing would be gained by not fixing all the mypy complaints as they arise. This will make
PR
#4755 much larger than expected. But that means that the later PRs should be shorter than expected.
Edward