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

Specify that __all__ should be a tuple #632

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pybind11/how-to.rst
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ We'll use the ``continueClass`` decorator to reopen the class and add a new meth

from ._tmpl import ExampleTwo

__all__ = [] # import for side effects
__all__ = () # import for side effects


@continueClass
Expand Down Expand Up @@ -999,7 +999,7 @@ As with ``ExampleTwo``, add this to a pure-Python ``_ExampleThree.py``:

from ._tmpl import ExampleThreeI, ExampleThreeD

__all__ = ["ExampleThree"]
__all__ = ("ExampleThree", )


class ExampleThree(metaclass=TemplateMeta):
Expand Down
2 changes: 1 addition & 1 deletion python/style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ Within a module, follow the order:
#. Shebang line, ``#! /usr/bin/env python`` (only for executable scripts)
#. Module-level comments (such as the `license statement <https://github.com/lsst/templates/tree/main/file_templates/stack_license_py>`__)
#. Module-level docstring
#. ``__all__ = [...]`` statement, if present
#. ``__all__ = (...)`` statement, if present
#. Imports
#. Private module variables (names start with underscore)
#. Private module functions and classes (names start with underscore)
Expand Down
2 changes: 1 addition & 1 deletion stack/module-homepage-topic-type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ You may need to exclude APIs from automodapi_ for two reasons:
2. The API includes a broken docstring, and you need to remove that API temporarily.

The main tool for removing non-public APIs from the published documentation is ``__all__``.
Each module should provide an ``__all__`` that explicitly lists the module’s public APIs.
Each module should provide an ``__all__`` tuple that explicitly lists the module’s public APIs.
`automodapi`_ respects ``__all__``.

.. _module-homepage-automodapi-skip:
Expand Down
Loading