I thought something like that would work; I was hoping for a way that doesn't involve that area of the codebase. Thanks for your help.
On Monday, September 19, 2022 at 4:10:55 PM UTC-4 [email protected] wrote: > 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. > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/61b64c43-cdfb-4c0b-bc0b-d978478d5576n%40googlegroups.com.
