bpo-1198569: Allow string.Template braced pattern to be different#3288
bpo-1198569: Allow string.Template braced pattern to be different#3288warsaw merged 3 commits intopython:masterfrom
Conversation
``string.Template`` subclasses can optionally define ``braceidpattern`` if they want to specify different placeholder patterns inside and outside the braces. If None (the default) it falls back to ``idpattern``.
Doc/library/string.rst
Outdated
| non-braced placeholders. The default value is the regular expression | ||
| ``[_a-z][_a-z0-9]*``. If this is given and *braceidpattern* is ``None`` | ||
| this pattern will also apply to braced placeholders (the braces will be | ||
| added automatically). |
There was a problem hiding this comment.
I think it is actually a bit confusing to say "the braces will automatically be added" here. Even the code doesn't do that, it is literally the case that braceidpattern defaults to idpattern, and I think that's all you need to say. Or, rather, since this is the idpattern description, you could say "Also used as braceidpattern if branceidpattern is None."
There was a problem hiding this comment.
Thanks! I agree that we can just remove the parenthetical comment.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
…thon#3288) * bpo-1198569: Allow the braced pattern to be different ``string.Template`` subclasses can optionally define ``braceidpattern`` if they want to specify different placeholder patterns inside and outside the braces. If None (the default) it falls back to ``idpattern``.
string.Templatesubclasses can optionally definebraceidpatternifthey want to specify different placeholder patterns inside and outside the
braces. If None (the default) it falls back to
idpattern.https://bugs.python.org/issue1198569