Skip to content

Spurious error when Unicode character names used in f-string #25

@t1m0thyj

Description

@t1m0thyj

Environment data

  • Language Server version: 2020.6.1
  • OS and version: Windows 10 1909
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.3 64-bit

Expected behaviour

No problems are found in the code snippet below.

Actual behaviour

Pylance finds problems because it incorrectly interprets the Unicode character \N{combining enclosing keycap} as an expression inside the f-string.

Logs

N/A

Code Snippet / Additional information

num_emojis = [f"{i}\N{combining enclosing keycap}" for i in range(1, 10)] + ["\N{keycap ten}"]

image

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed in next version (main)A fix has been implemented and will appear in an upcoming version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions