Skip to content
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

autodoc: empty __all__ attribute is ignored #8594

Closed
tk0miya opened this issue Dec 27, 2020 · 0 comments
Closed

autodoc: empty __all__ attribute is ignored #8594

tk0miya opened this issue Dec 27, 2020 · 0 comments

Comments

@tk0miya
Copy link
Member

tk0miya commented Dec 27, 2020

Describe the bug
autodoc: empty __all__ attribute is ignored

To Reproduce

# example.py
__all__ = []


def foo():
    "docstring"


def bar():
    "docstring"


def baz():
    "docstring"
# index.rst
.. automodule:: example
   :members:

All foo, bar, and baz are shown.

Expected behavior
No entries should be shown because __all__ is empty.

Your project
No

Screenshots
No

Environment info

  • OS: Mac
  • Python version: 3.9.1
  • Sphinx version: HEAD of 3.x
  • Sphinx extensions: sphinx.ext.autodoc
  • Extra tools: No

Additional context
No

@tk0miya tk0miya added this to the 3.5.0 milestone Dec 27, 2020
tk0miya added a commit to tk0miya/sphinx that referenced this issue Dec 27, 2020
An empty `__all__` should be represented as "there is no public items".
But autodoc considers all items on the module are public.  This changes
the behavior to correct one.
tk0miya added a commit to tk0miya/sphinx that referenced this issue Dec 27, 2020
An empty `__all__` should be represented as "there is no public items".
But autodoc considers all items on the module are public.  This changes
the behavior to correct one.
tk0miya added a commit that referenced this issue Dec 28, 2020
Fix #8594: autodoc: empty __all__ attribute is ignored
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant