[issue24351] string.Template documentation incorrectly references "identifiers"

July Tikhonov report at bugs.python.org
Mon Jun 1 21:05:08 CEST 2015


New submission from July Tikhonov:

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.

----------
assignee: docs at python
components: Documentation
messages: 244607
nosy: docs at python, july
priority: normal
severity: normal
status: open
title: string.Template documentation incorrectly references "identifiers"
versions: Python 3.4, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24351>
_______________________________________


More information about the Python-bugs-list mailing list