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

any is a builtin, Any is a type -- use str over int #141

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions numba_rvsdg/tests/test_ast_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def compare(
self,
function: Callable[..., Any],
expected: dict[str, dict[str, Any]],
unreachable: set[int] = set(),
empty: set[int] = set(),
arguments: list[any] = [],
unreachable: set[str] = set(),
empty: set[str] = set(),
arguments: list[Any] = [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be unrelated but I am not sure it's good idea to have a list as a default argument? (Since it is mutable, it's generally not recommended to do that? )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle, yes. In this case the compare method treats these mutable structures as immutable, and so it's ok to define them as empty here. They are either empty or contain something, but will never be modified. It's a bit shorter than handing in None and then checking at the start of the function if the argument is None and the instantiating an empty container as a result.

):
# Execute function with first argument, if given. Ensure function is
# sane and make sure it's picked up by coverage.
Expand Down