Generate skeletons of a module in one file

Is there a way to generate skeletons of a module in one file (module_name.py) instead of having a file for each class inside of a module?

I am asking because of type hinting feature, if type hint stub is named after module_name(.pyi) and inside it there are type hints for all classes (that are originally in module_name.py), and PyCharm generates .py for each class so those type hints from module_name.pyi does not get recognized (even if each class_name.py gets imported in modul_name.py).

For example PyQT5.6, there's a module QtWidgets and it has a class named QApplication, since PyCharm makes both QtWidget.py and QApplication.py (and imports QApplication class to QtWidget.py) type hints for QApplication are not recognized from QWidget.pyi. If I copy content of QApplication.py to QtWidget.py and comment the import statement, then type hints work.

Please sign in to leave a comment.