Closed epenet closed 2 weeks ago
All modified and coverable lines are covered by tests :white_check_mark:
@@ Coverage Diff @@
## main #919 +/- ##
=======================================
Coverage 97.74% 97.74%
=======================================
Files 21 21
Lines 1596 1596
=======================================
Hits 1560 1560
Misses 36 36
🚨 Try these New Features:
:tada: This PR is included in version 4.8.0 :tada:
The release is available on:
v4.8.0
Your semantic-release bot :package::rocket:
Description
This was spotted when trying to enforce pyupgrade rules in ruff, and rule UP034 was causing issues: https://docs.astral.sh/ruff/rules/extraneous-parentheses/
Sometimes the first argument was a tuple
stdout.re_match_lines(("a","b"))
, sometimes it was a raw stringstdout.re_match_lines("a")
, and other times it was a bracketed raw stringstdout.re_match_lines(("a"))
Instead of simply converting the bracketed raw string into non-bracketed raw strings, I think it makes better sense to convert all the raw strings to tuples, as
result.stdout.re_match_lines
is supposed to have aSequence[str]
as first argument:Related Issues
Checklist
Additional Comments
This is not picked up by
mypy
as strings are also a sequence of single-character strings. Also, raw strings work behind the scene as they go through_getlines
which converts them to a sequence.