PR #3850 improves many annotations. This PR is too big for my liking. I'll make further improvements to annotations in smaller PRs.
PR #3855 improves support for Ruff.
Please see the PRs themselves for details.
Neither PR contains substantial code changes, but the possibility of new problems remains. Please report anything amiss immediately.
Edward