-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
string.Formatter does not support key/attribute access on unnumbered fields #71494
Comments
Support for unnumbered fields in string.Formatter.format was added in http://bugs.python.org/issue13598, however, it does not support accessing an index or attribute of an unnumbered field like str.format does. Instead, it raises an unhelpful "KeyError: ''":
The attached patch adds this functionality. aronancher asked in http://bugs.python.org/issue13598#msg218114 if the original patch was going to make it in to python 2.7. Perhaps that could get a look? |
It would be good if someone could convert this to a pull request and beef up the tests. |
I'll take a look at the patch and see if this solves my problem. If it does, I'll update my PR with tests. |
Looks like the patch solves my problem, so I am going to update my PR sometime today. |
Okay, well it doesn't provide the desired behavior of raising the error when switching back and forth between manual and auto numbering, so I am looking into that. |
Fixed by: #21767 |
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: