-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
bpo-1198569: Allow string.Template braced pattern to be different #3288
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.Template
subclasses can optionally definebraceidpattern
ifthey 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