Python type hints with imported class methods
问题 In order to split a large class into multiple files, this answer, recommends using the import command at the class level to load methods whose definitions can be moved to other modules. As a minimal example, class_def.py : class C: from _methods import m _methods.py : def m(self): return "hello" Normally, most IDEs which feature code completion will recognize functions which are defined in some class as bound methods, and self will automatically be recognized as having the type of the class