Pregunta

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:

¿Fue útil?

Solución

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top