What is .pyi file
Sometimes in VSCode, we want to “jump to declaration”, then IDE redirect us to a file with suffix .pyi, and all it contains are some strange code like this:
1 | class Object: |
It looks like .h file in C++, only declares the function signature, typedef, etc without any implementation.
Actually, a .pyi file is not required but recommended, the only purpose for .pyi file is: IDE can provide auto complete and programmer can read the APIs fast and don’t need to care about the implementation details.