Skip to content

Commit b16cb58

Browse files
authored
Merge pull request #411 from asottile/py314
remove __future__.annotations in 3.14
2 parents 5aef831 + 0182574 commit b16cb58

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

reorder_python_imports.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ def _fix_file(
415415
'from __future__ import unicode_literals',
416416
))
417417
REMOVALS[(3, 7)].add('from __future__ import generator_stop')
418+
REMOVALS[(3, 14)].add('from __future__ import annotations')
418419
# END GENERATED
419420

420421
# GENERATED VIA generate-typing-rewrite-info

testing/generate-future-info

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ import sys
1010
def main() -> int:
1111
assert sys.version_info >= (3, 10), 'need python3.10'
1212

13+
by_version: dict[tuple[int, ...], list[str]]
1314
by_version = collections.defaultdict(list)
1415

1516
for k, v in vars(__future__).items():
1617
if k == 'barry_as_FLUFL' or not hasattr(v, 'mandatory'):
1718
continue
1819

20+
version: tuple[int, ...]
1921
if v.mandatory is None:
2022
continue
2123
elif v.mandatory[1] == 0:
@@ -25,6 +27,9 @@ def main() -> int:
2527

2628
by_version[version].append(k)
2729

30+
# no longer needed!
31+
by_version[(3, 14)].append('annotations')
32+
2833
print(f'# GENERATED VIA {os.path.basename(sys.argv[0])}')
2934
for version, names in sorted(by_version.items()):
3035
if len(names) == 1:

0 commit comments

Comments
 (0)