I'm trying to start a Python project and I want to be disciplined and use static type checking. I've used Python for years and I've used strong typed languages (c, go) but I'm having a hard time finding a good guide for how to do static type checking in Python well. I've tried just running pyright, but it throws a bunch of errors about modules I'm loading (configargparse, I'm looking at you). From what I've read, I'm supposed to generate stubs for the external modules. I ran 'pyright --createstub configargparse' and 'pyright --createstub argparse' but I still get lots of errors. For example, config_parser.add('--verbose', '-v', help='verbose', action='count', default=0) Pyright complains warning: Type of "add" is unknown (reportUnknownMemberType). The "add" in question is a method on a configarparse.ArgParser object. I generated stubs for the configargparse and argparse modules, so I don't see what else I can do. I don't want to just mask this by throwing # ignore all over the place. What I'd really like is a good document that tells me how to do static type checking properly and usefully, instead of how to hide problems. I'd rather understand it than just make it stop complaining and not know why. Thanks! Continue reading...