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.Template documentation incorrectly references "identifiers" #68539
Comments
Documentation of Template says: $identifier names a substitution placeholder matching a mapping key of "identifier". By default, "identifier" must spell a Python identifier. The first non-identifier character after the $ character terminates this placeholder specification. While it was true when these lines were written, Python 3 has greatly extended identifier character set, and it no longer matches the set of characters used by Template: >>> Template('$foo123щъ').substitute(foo=1, foo123=2, foo123щъ=3)
'2щъ' I propose clarifying documentation. Actually extending character set is backward-incompatible, although it won't be if restricted to "${identifier}" syntax. |
Rather than change the code, which strives to keep the "Simple" in PEP-292's title, I'd rather just update the documentation to define what "identifier" means here. E.g. "
|
+1 for keeping the current behavior and fixing the docs. |
New changeset 20bf84cd38bc by Barry Warsaw in branch '3.4':
New changeset 0fa48f581fe3 by Barry Warsaw in branch '3.5':
New changeset 1cdedc9a9e9f by Barry Warsaw in branch 'default':
|
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: