I'm not very familiar with the Leo codebase and don't have a working
version downloaded at the moment, but like mypy and can maybe offer a
suggestion. Browsing the code, it looks like c.config is set in
initSettings (
https://github.com/leo-editor/leo-editor/blob/master/leo/core/leoCommands.py#L432).
mypy indeed does not understand that c.config will always be a member
variable of a given type. Even if you notate the variable in that
section, I suspect that the typechecker won't pick it up properly. I
believe the solution would be to annotate the existence of c.config
while leaving that assignment alone. Something like:
config: LocalConfigManager
inside the class but before any method definitions should do the
trick. That is, a type annotation without any kind of assignment
involved.