File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,8 @@ results. Use ``callable(x)`` for consistent results.
80
80
**B005 **: Using ``.strip() `` with multi-character strings is misleading
81
81
the reader. It looks like stripping a substring. Move your
82
82
character set to a constant if this is deliberate. Use
83
- ``.replace() `` or regular expressions to remove string fragments.
83
+ ``.replace() ``, ``.removeprefix() ``, ``.removesuffix() `` or regular
84
+ expressions to remove string fragments.
84
85
85
86
**B006 **: Do not use mutable data structures for argument defaults. They
86
87
are created during function definition time. All calls to the function
Original file line number Diff line number Diff line change @@ -1306,7 +1306,8 @@ def visit_Lambda(self, node):
1306
1306
"B005 Using .strip() with multi-character strings is misleading "
1307
1307
"the reader. It looks like stripping a substring. Move your "
1308
1308
"character set to a constant if this is deliberate. Use "
1309
- ".replace() or regular expressions to remove string fragments."
1309
+ ".replace(), .removeprefix(), .removesuffix(), or regular "
1310
+ "expressions to remove string fragments."
1310
1311
)
1311
1312
)
1312
1313
B005 .methods = {"lstrip" , "rstrip" , "strip" }
You can’t perform that action at this time.
0 commit comments