Skip to content

type annotation with Optional #2456

Answered by Kodiologist
ghost asked this question in Q&A
Jun 12, 2023 · 2 comments · 7 replies
Discussion options

You must be logged in to vote

Personally, when I read (get Optional int), it seems to be saying "reach into Optional and get the int item".

That's an issue with Python itself, not Hy. (get x y) is translated exactly to x[y]. You can still make a macro with your preferred syntax (or use of), if you like.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
3 replies
@ghost
Comment options

@Kodiologist
Comment options

Answer selected
@ghost
Comment options

Comment options

You must be logged in to vote
4 replies
@goyalyashpal
Comment options

@goyalyashpal
Comment options

@Kodiologist
Comment options

@goyalyashpal
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants