[BE][Ez]: Enable RUF007 Prefer itertools.pairwise over zip slicing (#164856)

Now that our min version is 3.10 we can support this rule. This is more concise, readable, and efficient than the previous zip slicing.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/164856
Approved by: https://github.com/williamwen42
This commit is contained in:
Aaron Gokaslan
2025-10-07 22:51:13 +00:00
committed by PyTorch MergeBot
parent 6861a27062
commit d1a62c8036
11 changed files with 16 additions and 12 deletions

View File

@ -242,6 +242,7 @@ select = [
"Q003", # avoidable escaped quote
"Q004", # unnecessary escaped quote
"RSE",
"RUF007", # pairwise over zip
"RUF008", # mutable dataclass default
"RUF013", # ban implicit optional
"RUF015", # access first ele in constant time