Skip to content

Improve error message for strings with conflicting prefixes #133197

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

Open
sobolevn opened this issue Apr 30, 2025 · 2 comments
Open

Improve error message for strings with conflicting prefixes #133197

sobolevn opened this issue Apr 30, 2025 · 2 comments
Assignees
Labels
3.14 new features, bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-parser type-feature A feature request or enhancement

Comments

@sobolevn
Copy link
Member

sobolevn commented Apr 30, 2025

Feature or enhancement

Right now it is:

>>> ft'a'
  File "<python-input-3>", line 1
    ft'a'
      ^^^
SyntaxError: invalid syntax

I propose:

>>> ft'a'
  File "<python-input-3>", line 1
    ft'a'
      ^^^
SyntaxError: can't use both "f" and "t" prefixes for strings at the same time

cc @lysnikolaou

I am working on the issue :)

Linked PRs

@sobolevn sobolevn added 3.14 new features, bugs and security fixes topic-parser type-feature A feature request or enhancement labels Apr 30, 2025
@sobolevn sobolevn self-assigned this Apr 30, 2025
@sobolevn sobolevn changed the title Improve error message for strings that use both f and t prefix at the same time Improve error message for strings with conflicting prefixes Apr 30, 2025
@terryjreedy
Copy link
Member

More tersely, "f" and "t" prefixes are incompatible.

@sobolevn
Copy link
Member Author

I can change the one I commited when working on new ones. I like your suggestion! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.14 new features, bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-parser type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants