Frage

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:

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top