Skip to content

util: Remove deprecated Dict, List, Union, Tuple, Optional type hints #514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 1, 2025

Conversation

sonic2kk
Copy link
Contributor

@sonic2kk sonic2kk commented Apr 1, 2025

Similar to #513, I thought this would be a trickier one to do and we would have a ton of usages, but going slow and by hand, it wasn't so bad :-)

This should be all of the deprecated type hints I think. I did a Find in Files for from typing import and the remaining usages outside of these last few PRs are all valid imports of Any and Callable.

@DavidoTek
Copy link
Owner

Thanks!

Callable | None

I find it interesting thatit is actually the official notation for the Option type: https://docs.python.org/3/library/stdtypes.html#types-union

I somehow would have expected something like str? from Python, but on the other hand, this is a very simple and unambiguous way to describe it.

"Optional types can be spelled as a union with None: str | None == typing.Optional[str]"

@DavidoTek DavidoTek merged commit a82eeab into DavidoTek:main Apr 1, 2025
2 checks passed
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