-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
f-string error description seems wrong #85847
Comments
There seems to an error in the >>> f'{1:,,}'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Cannot specify both ',' and '_'.
>>> The error seems to be that, i am not specifying both ',' and '_', but it does seem to think so. This also seems to be happening for >>> '{:,,}'.format(1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Cannot specify both ',' and '_'. So i was just wondering if this is an issue worth raising :) Thank you |
It has to do with how the specification for the mini-language is parsed and how the defaults work. It could probably be fixed, but I'm personally not super motivated to track it down. But I'd look at a patch! I'm going to remove versions that we wouldn't backport this to. |
Sure. Thanks for the quick response :) Let me see if i can try to come up with something :) |
I have raised a pull request for the fix #22036. Your review is appreciated :) |
f-string/str.format
error description when using 2,
in format specifier #22036f-string/str.format
error description when using 2,
in format specifier (GH-22036) #22041f-string/str.format
error description (GH-22036) #22059Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: