Skip to content

Commit

Permalink
Merge pull request #88 from daizutabi/feature-tuple-all
Browse files Browse the repository at this point in the history
Allow tuple __all__
  • Loading branch information
daizutabi authored Feb 11, 2024
2 parents f5e86e1 + e58d183 commit 5859fdb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mkapi/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ def _iter_objects(module: str) -> Iterator[str]:
def _iter_all(node: ast.AST) -> Iterator[str]:
if isinstance(node, ast.Assign): # noqa: SIM102
if mkapi.ast.get_assign_name(node) == "__all__": # noqa: SIM102
if isinstance(node.value, ast.List):
for c in node.value.elts:
if isinstance(c, ast.Constant) and isinstance(c.value, str):
yield c.value
if isinstance(node.value, ast.List | ast.Tuple):
for arg in node.value.elts:
if isinstance(arg, ast.Constant) and isinstance(arg.value, str):
yield arg.value


def _iter_objects_from_all(module: str) -> Iterator[str]:
Expand Down

0 comments on commit 5859fdb

Please sign in to comment.