I want to import * from module X into main module, but without importing X's documentation. Example:

# X.py
class Class:
    '''Surplus description'''
    ...

and the main:

# main.py
'''My only document'''
from X import *

Now pydoc main will show documentation from X and main, and I don't want X docs here

Related:

有帮助吗?

解决方案

If you set the __all__ attribute, pydoc will only show objects listed there.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top