diff --git a/docs/checks.md b/docs/checks.md index 4ac1d3f..b61ae84 100644 --- a/docs/checks.md +++ b/docs/checks.md @@ -2330,9 +2330,9 @@ Bad: ```python names = ["Bob", "Alice", "Charlie"] -names = reverse(names) +names = reversed(names) # or -names = list(reverse(names)) +names = list(reversed(names)) # or names = names[::-1] ``` diff --git a/refurb/checks/readability/use_reverse.py b/refurb/checks/readability/use_reverse.py index 4b32bcf..52480a7 100644 --- a/refurb/checks/readability/use_reverse.py +++ b/refurb/checks/readability/use_reverse.py @@ -26,9 +26,9 @@ class ErrorInfo(Error): ``` names = ["Bob", "Alice", "Charlie"] - names = reverse(names) + names = reversed(names) # or - names = list(reverse(names)) + names = list(reversed(names)) # or names = names[::-1] ```