Skip to content

Commit 85fe576

Browse files
janselpytorchmergebot
authored andcommitted
[set_linter] allow x in {...} (#148422)
Pull Request resolved: #148422 Approved by: https://github.com/Skylion007
1 parent 9cb25f0 commit 85fe576

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tools/linter/adapters/set_linter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ def is_set(self, i: int) -> bool:
134134
def is_braced_set(self, begin: int, end: int) -> bool:
135135
if begin + 1 == end or self.tokens[begin].string != "{":
136136
return False
137+
if begin and self.tokens[begin - 1].string == "in":
138+
return False # skip `x in {1, 2, 3}`
137139
i = begin + 1
138140
empty = True
139141
while i < end:

0 commit comments

Comments
 (0)