Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix ruff compressions and performance issues #490

Merged
merged 3 commits into from
Nov 25, 2024
Merged
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: 1 addition & 3 deletions autoapi/_astroid_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ class NotConstException(Exception):

def _inner(node: astroid.nodes.NodeNG) -> Any:
if isinstance(node, (astroid.nodes.List, astroid.nodes.Tuple)):
new_value = []
for element in node.elts:
new_value.append(_inner(element))
new_value = [_inner(element) for element in node.elts]

if isinstance(node, astroid.nodes.Tuple):
return tuple(new_value)
Expand Down
2 changes: 1 addition & 1 deletion autoapi/_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def _ask_ignore(self, skip: bool) -> bool:
return ask_result if ask_result is not None else skip

def _children_of_type(self, type_: str) -> list[PythonObject]:
return list(child for child in self.children if child.type == type_)
return [child for child in self.children if child.type == type_]


class PythonFunction(PythonObject):
Expand Down
1 change: 1 addition & 0 deletions docs/changes/490.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix ruff compressions and performance issues.
Loading