Skip to content

Conversation

Glyphack
Copy link
Contributor

@Glyphack Glyphack commented Sep 3, 2024

I noticed there are two strings as type annotation and I thought this is not intended because if I understand correctly forward annotations cannot consist of two string literals.

Although this is syntactically correct because the strings can be concatenated. But testing it out on pyright for example this does not pass:

a: "int" "| string" = 1  # error: Expected type but received a string literal (reportGeneralTypeIssues)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@JelleZijlstra JelleZijlstra merged commit f816a64 into python:main Sep 3, 2024
5 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