Skip to content

Commit

Permalink
Added file rule explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
netromdk committed Jan 12, 2020
1 parent f919cc5 commit 5e837ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vermin/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,11 @@ def MOD_MEM_REQS():
"zipfile.BadZipFile": (None, (3, 2)),

# Builtin functions
# Notes:
# file() is kept at 2.0 instead of 2.2, where the function was introduced, because file objects
# have existed since 2.0 and we don't do type deduction. Therefore analysis on file objects
# wouldn't be detected, like `open(..).xreadlines()`, but using `file(..).xreadlines()` would
# trigger rule "file.xreadlines" 2.1. So if file() was kept at 2.2 it would introduce conflict.
"all": ((2, 5), (3, 0)),
"any": ((2, 5), (3, 0)),
"basestring": ((2, 3), None),
Expand All @@ -455,7 +460,7 @@ def MOD_MEM_REQS():
"dict.viewkeys": ((2, 7), None),
"dict.viewvalues": ((2, 7), None),
"enumerate": ((2, 3), (3, 0)),
"file": ((2, 0), None),
"file": ((2, 0), None), # Kept at 2.0 on purpose (see note above).
"file.next": ((2, 3), None),
"file.xreadlines": ((2, 1), None),
"float.as_integer_ratio": ((2, 6), (3, 0)),
Expand Down

0 comments on commit 5e837ab

Please sign in to comment.