Skip to content

Commit

Permalink
Revise example in README file to fix #272.
Browse files Browse the repository at this point in the history
  • Loading branch information
jendrikseipp committed Jan 8, 2023
1 parent 4d694a6 commit 86ea96b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
* Add whitelist for `socketserver.TCPServer.allow_reuse_address` (Ben Elliston)
* Clarify that `--exclude` patterns are matched against absolute paths (Jendrik Seipp, #260).
* Fix example in README file (Jendrik Seipp, #272).

# 2.6 (2022-09-19)

Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ class Greeter:
def hello_world():
message = "Hello, world!"
greeter = Greeter()
greet_func = getattr(greeter, "greet")
func_name = "greet"
greet_func = getattr(greeter, func_name)
greet_func()
if __name__ == "__main__":
Expand All @@ -252,8 +253,8 @@ results in the following output:
dead_code.py:4: unused function 'greet' (60% confidence)
dead_code.py:8: unused variable 'message' (60% confidence)

Vulture correctly reports "os" and "message" as unused, but it fails to
detect that "greet" is actually used. The recommended method to deal
Vulture correctly reports `os` and `message` as unused but it fails to
detect that `greet` is actually used. The recommended method to deal
with false positives like this is to create a whitelist Python file.

**Preparing whitelists**
Expand Down

0 comments on commit 86ea96b

Please sign in to comment.