3

I have a module dlprim

dlprim/
 __init__.py
 netconfig.py
 _pydlprim.so

its __init__.py incldes:

from ._pydlprim import *
from .netconfig import *

where ._pydlprim is boost.pythom module and .netconfig is submodule.

If I generate a documentation with pydoc -w dlprim - it does not include classes from _pydlprim and netconfig.py so in order to generate them all I need to run pydoc -w dlprim dlprim.netconfig dlprim._pydlprim

But I get 3 separate files each in different namespace I want all of the classes to be found under dlprim module and namespace in pydoc.

How can I do it, or is there an alternative for this?

asked Sep 16, 2021 at 9:37

1 Answer 1

2
+100

Put the names of those re-exported items in __all__.

from ._pydlprim import *
from .netconfig import *
def _all_of(mod):
 try:
 yield from mod.__all__
 return
 except AttributeError:
 pass
 for item in dir(mod):
 if not item.startswith('_'):
 yield item
__all__ = [*_all_of(_pydlprim), *_all_of(netconfig)]
answered Sep 29, 2021 at 21:23
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.