Skip to content

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

@ilevkivskyi

Description

@ilevkivskyi

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy