Skip to content

[BE] Apply pep585 and turn on flake8 rule so no regressions#2411

Merged
Lucaskabela merged 2 commits intopytorch:mainfrom
Lucaskabela:lucaskabela/pep_585_fix
Feb 24, 2026
Merged

[BE] Apply pep585 and turn on flake8 rule so no regressions#2411
Lucaskabela merged 2 commits intopytorch:mainfrom
Lucaskabela:lucaskabela/pep_585_fix

Conversation

@Lucaskabela
Copy link
Contributor

@Lucaskabela Lucaskabela commented Feb 20, 2026

Since python>=3.10 is defined in the pyproject.toml, we can enable pep585 (in python >=3.9)

Why?

  1. Fewer imports making code simpler
  2. Standardization - prior to this change, we could have List and list intermixed in the codebase
  3. Future proof for direction of python type system

Test

Ran

 python -m flake8 --pep585-activation=always .

Explicitly

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 20, 2026
@Lucaskabela Lucaskabela force-pushed the lucaskabela/pep_585_fix branch from a9196f8 to 21ea7f0 Compare February 20, 2026 22:07
@Lucaskabela Lucaskabela marked this pull request as ready for review February 20, 2026 23:26
@fegin
Copy link
Contributor

fegin commented Feb 23, 2026

Nice BE task, but you have to rebase after #2386 is landed.

@Lucaskabela Lucaskabela force-pushed the lucaskabela/pep_585_fix branch from 21ea7f0 to a21c9dd Compare February 23, 2026 21:00
@Lucaskabela
Copy link
Contributor Author

Hi @fegin - should be ready for review :)

@Lucaskabela Lucaskabela merged commit 736f12d into pytorch:main Feb 24, 2026
24 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants