Skip to content

Commit

Permalink
Merge pull request #705 from MarcoGorelli/remove-289-rewrite
Browse files Browse the repository at this point in the history
remove pep289 rewrite
  • Loading branch information
asottile authored Sep 12, 2022
2 parents ad5d9db + f198b1a commit 443bc1e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 202 deletions.
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,6 @@ Sample `.pre-commit-config.yaml`:
```


### Generator expressions for some built-in functions (pep 289)

```diff
-min([i for i in range(3)])
+min(i for i in range(3))
-max([i for i in range(3)])
+max(i for i in range(3))
-sum([i for i in range(3)])
+sum(i for i in range(3))
-''.join([str(i) for i in range(3)])
+''.join(str(i) for i in range(3))
```

### Python2.7+ Format Specifiers

```diff
Expand Down
61 changes: 0 additions & 61 deletions pyupgrade/_plugins/generator_expressions_pep289.py

This file was deleted.

7 changes: 0 additions & 7 deletions pyupgrade/_token_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,13 +510,6 @@ def find_comprehension_opening_bracket(i: int, tokens: list[Token]) -> int:
return i


def replace_list_comp_brackets(i: int, tokens: list[Token]) -> None:
start = find_comprehension_opening_bracket(i, tokens)
end = find_closing_bracket(tokens, start)
tokens[end] = Token('OP', ')')
tokens[start] = Token('OP', '(')


def has_space_before(i: int, tokens: list[Token]) -> bool:
return i >= 1 and tokens[i - 1].name in {UNIMPORTANT_WS, 'INDENT'}

Expand Down
121 changes: 0 additions & 121 deletions tests/features/generator_expressions_pep289_test.py

This file was deleted.

0 comments on commit 443bc1e

Please sign in to comment.