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

Aliases to literal types can cause str/unicode confusion in stub files on Python 2 #8062

Closed
ilevkivskyi opened this issue Dec 3, 2019 · 1 comment
Labels
bug mypy got something wrong priority-2-low topic-literal-types topic-python2 issues only applicable to Python 2

Comments

@ilevkivskyi
Copy link
Member

This doesn't work properly when put in a stub file in Python 2 mode:

alias = Literal[u'foo']
a: alias
reveal_type(a3)  # Revealed type is Literal['foo'], but must be Literal[u'foo']

See #8026 (review) for context.

@JukkaL
Copy link
Collaborator

JukkaL commented Mar 31, 2022

Closing due to Python 2 feature freeze (#12237).

@JukkaL JukkaL closed this as completed Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong priority-2-low topic-literal-types topic-python2 issues only applicable to Python 2
Projects
None yet
Development

No branches or pull requests

3 participants