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

Problems with named unicode in combination with Fstrings #161

Closed
xmatthias opened this issue Jul 23, 2020 · 3 comments
Closed

Problems with named unicode in combination with Fstrings #161

xmatthias opened this issue Jul 23, 2020 · 3 comments
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@xmatthias
Copy link

xmatthias commented Jul 23, 2020

Environment data

  • Language Server version: 2020.7.3
  • OS and version: linux
  • Python version (& distribution if applicable, e.g. Anaconda): python 3.8.2

Expected behaviour

No error, since the syntax is valid and prints the Greek SUM letter correctly
(200 Σ).

Not having this in an fstring results in no error - so i guess the fstring { detection ignores the leading \N.

Actual behaviour

Pylance shows error "Unexpected token at end of expression" for fstring

2020-07-23-064716_915x230_scrot

Code Snippet / Additional information

hello = 200
# The following line shows both GREEK and CAPITAL as error
print(f"({hello} \N{GREEK CAPITAL LETTER SIGMA})")

print("\N{GREEK CAPITAL LETTER SIGMA})")
@erictraut
Copy link
Contributor

Thanks for the bug report. There was a bug in unicode name parsing related to capital letters. A fix will be in the next version of Pylance. While you're waiting for the fix, you can work around the issue by using lower-case characters ("greek capital letter sigma").

@erictraut erictraut added bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version labels Jul 23, 2020
@jakebailey
Copy link
Member

jakebailey commented Jul 29, 2020

This issue has been fixed in version 2020.7.4, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202074-29-july-2020

@xmatthias
Copy link
Author

xmatthias commented Jul 30, 2020

Great, thanks! 👍

can confirm that the issue is gone with this release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

3 participants