Skip to content
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

Add _typeshed.MaybeNone? #10575

Closed
srittau opened this issue Aug 14, 2023 · 2 comments
Closed

Add _typeshed.MaybeNone? #10575

srittau opened this issue Aug 14, 2023 · 2 comments
Labels
project: policy Organization of the typeshed project

Comments

@srittau
Copy link
Collaborator

srittau commented Aug 14, 2023

We often use a construct like -> int | Any when we want to say -> int | None, but can't for some reason. I'd like to propose a new type alias MaybeNone: TypeAlias = Any to _typeshed (name subject to discussion) to mark such occurrences. This would help document the reason Any is used and could help us if something like python/typing#566 is ever implemented.

@srittau srittau added the project: policy Organization of the typeshed project label Aug 14, 2023
@AlexWaygood
Copy link
Member

We previously discussed this in #7870, but couldn't come to an agreement on what the best name would be, IIRC

@srittau
Copy link
Collaborator Author

srittau commented Aug 14, 2023

You are right, I forgot about that ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project: policy Organization of the typeshed project
Projects
None yet
Development

No branches or pull requests

2 participants