New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
explicit re-export from a private module should make the member public #667
Comments
This feels more like a hack than anything else, but given that it's in PEP 484 I'd be happy to merge a PR that adds support for it. Fwiw, a strict reading of the spec seems to imply this only applies to stub files of I'm not mistaken... As a workaround, I'd recommend to just declare |
tell me about it, that's python typing for you lol
yeah i don't know why but for some reason most of the documentation and discussions around python typing seems to imply that you'd only ever use types in stubs and not actual source code. but the two main type checkers support this explicit re-export "syntax" outside of stubs (mypy and pyright) so i think it's safe to assume this behavior is intended to work in regular source code too
thanks. though i'm not really a fan of # foo/public_module.py
from _private_module import foo as _foo
foo = _foo
"""the downside is that i have to move the docstring here tho""" |
Problem Description
in python typing, an import alias with the same name is considered an explicit re-export:
see https://peps.python.org/pep-0484/#stub-files:
however pdoc does not recognize this and does not include the name in the docs, when it is intended to be public.
Steps to reproduce the behavior:
pdoc foo
System Information
The text was updated successfully, but these errors were encountered: