-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FURB111 now detects instances of `lambda: x`, where `x` is the default literal value for a builtin type. For example, the default value of `bool()` is `False`, `int()` is `0`, and so on. Similar to how `lambda: []` should be written as `list`, instances of `lambda: 0` (and other literal values) should be written as `int`. Pyupgrade can already detect these new cases, but for whatever reason, it only detects them in `defaultdict()` calls and nowhere else. With that in mind I decided to implement this anyways, but without the `defaultdict()` restriction. Pyupgrade also doesn't check `lambda: b""`, though this is probably not very common.
- Loading branch information
Showing
5 changed files
with
100 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters