Skip to content

Remove Union and Optional Typehints and replace with pipe annotations#965

Open
Vizonex wants to merge 2 commits intojcrist:mainfrom
Vizonex:update-typehints
Open

Remove Union and Optional Typehints and replace with pipe annotations#965
Vizonex wants to merge 2 commits intojcrist:mainfrom
Vizonex:update-typehints

Conversation

@Vizonex
Copy link
Copy Markdown

@Vizonex Vizonex commented Dec 16, 2025

I would assume that 3.9 is dropped at this point in time so I made some pretty significant changes to how annotations are written out in the main library using Ruff with UP045 and UP007 to help remove typing.Optional and typing.Union since these items are now treated as deprecated after 3.9 if we did want backwards compatability for 3.9 we could add in from __future__ import annotations but I would assume that 3.9 is dropped for good, hence this pull request being made by me.

@ofek
Copy link
Copy Markdown
Collaborator

ofek commented Dec 16, 2025

Perhaps you can answer this question #954 (comment)

@provinzkraut
Copy link
Copy Markdown
Contributor

since these items are now treated as deprecated after 3.9 if we did want backwards compatability for 3.9 we could add in from __future__ import annotations but I would assume that 3.9 is dropped for good, hence this pull request being made by me.

IMO we should support these feature as long as they're in a supported Python version. Otherwise we're not really compatible with e.g. Python 3.9, if you can't use certain 3.9 features just because they're deprecated

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.

3 participants