You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: 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:
assignee=Noneclosed_at=<Date2021-01-25.09:58:07.573>created_at=<Date2016-08-16.04:35:18.934>labels= ['interpreter-core', '3.10']
title='Refer to actual format string when creating \xe2\x80\x9czero padding\xe2\x80\x9d error message'updated_at=<Date2021-01-25.09:58:07.570>user='https://bugs.python.org/bignose'
'=' […] becomes the default when ‘0’ immediately precedes the field width.
When the ‘=’ option is only implied, the error message “ValueError: '=' alignment not allowed in string format specifier” becomes surprising and incomprehensible to someone who does not know that implied behaviour.
If the spec string is still available, it could be searched and the message adjusted if '=' is not present. That proposal should be a new issue if someone wants to push it.
This issue raises that proposal.
The error message should be changed so that:
It makes sense whether or not the ‘=’ option is explicit in the format specifier.
Or:
Different messages are produced when the ‘=’ option is explicit versus when it is implicit.
I think the former option is better, but either will satisfy this request.
PR 11270 fixes this issue by making such format valid. Preceding the width field by '0' no longer affects the default alignment for strings, i.e. no longer sets the alignment to invalid '=' if it is not specified explicitly.
Note: 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: