Skip to content

python: Use builtin generics and X | Y unions in annotations - #309

Merged
jerry-skydio merged 1 commit into
mainfrom
jerry/revup/main/types
Oct 3, 2026
Merged

jerry-skydio merged 1 commit into
mainfrom
jerry/revup/main/types

Conversation

@jerry-skydio

Copy link
Copy Markdown
Collaborator

Every module now has from __future__ import annotations, so annotations can use
list/dict/set/tuple/type and X | None instead of the typing equivalents. Only
code that evaluates types at runtime (shell._HANDLE, a cast in git.py) still
imports from typing.

Ruff enforces this going forward: UP006/UP007/UP045/UP037 reject the old spellings
and quoted annotations, and FA102 catches the new ones in a file that's missing
the future import, which would break on python 3.8.

@jerry-skydio

jerry-skydio commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

Reviews in this chain:
└#309 python: Use builtin generics and X | Y unions in annotations

@jerry-skydio

jerry-skydio commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator Author
# head base diff date summary
0 b564d0b8 a7c727b5 diff Oct 1 16:09 PM 19 files changed, 346 insertions(+), 339 deletions(-)
1 53fe62cb a8247f6b rebase Oct 1 16:10 PM 0 files changed
2 4f36ed71 72410575 rebase Oct 1 16:11 PM 0 files changed
3 ed233706 bf23bba1 diff Oct 2 17:00 PM 0 files changed

Base automatically changed from jerry/revup/main/Uploadrelatives to main October 2, 2026 23:59
Every module now has `from __future__ import annotations`, so annotations can use
list/dict/set/tuple/type and `X | None` instead of the typing equivalents. Only
code that evaluates types at runtime (shell._HANDLE, a cast in git.py) still
imports from typing.

Ruff enforces this going forward: UP006/UP007/UP045/UP037 reject the old spellings
and quoted annotations, and FA102 catches the new ones in a file that's missing
the future import, which would break on python 3.8.
@jerry-skydio
jerry-skydio force-pushed the jerry/revup/main/types branch from 4f36ed7 to ed23370 Compare October 3, 2026 00:00
@jerry-skydio
jerry-skydio merged commit e628561 into main Oct 3, 2026
6 checks passed
@jerry-skydio
jerry-skydio deleted the jerry/revup/main/types branch October 3, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants