[BE][Ez]: Use interned hardcoded string FURB156 (#138330)

Uses string constants from string module.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/138330
Approved by: https://github.com/albanD
This commit is contained in:
Aaron Gokaslan
2024-10-18 18:26:14 +00:00
committed by PyTorch MergeBot
parent 9c2a80322a
commit 195d0a666b
4 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,6 @@
from __future__ import annotations
import string
from collections import defaultdict
from typing import Sequence
@ -194,9 +195,7 @@ def generate_out_args_from_schema(
lambda a: [] if a.annotation is None else a.annotation.alias_set,
func.arguments.flat_all,
)
valid_annotations = [
x for x in "abcdefghijklmnopqrstuvwxyz" if x not in used_annotations
]
valid_annotations = [x for x in string.ascii_lowercase if x not in used_annotations]
all_rets_are_tensors = all(r.type == BaseType(BaseTy.Tensor) for r in func.returns)