Skip to content

Commit

Permalink
refactor: remove unnecessary comprehension
Browse files Browse the repository at this point in the history
The built-in function being used does not require comprehension and can work directly with a generator expression.
  • Loading branch information
deepsource-autofix[bot] authored Apr 3, 2024
1 parent cab3713 commit 49c60da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/demo_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def limits(self):

def get_number(self, min_max=[1, 10]):
"""Get a random number between min and max."""
assert all([isinstance(i, int) for i in min_max])
assert all(isinstance(i, int) for i in min_max)
return random.randint(*min_max)


Expand Down
2 changes: 1 addition & 1 deletion python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def is_prime(x):
return False
return True

return all([is_prime(num) for num in nums])
return all(is_prime(num) for num in nums)


def store_paths(matrix: list[list[int]], i: int, j: int, path=[]) -> None:
Expand Down

0 comments on commit 49c60da

Please sign in to comment.