Skip to content
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

Merged
merged 3 commits into from
Sep 4, 2017

Conversation

warsaw
Copy link
Member

@warsaw warsaw commented Sep 4, 2017

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.

https://bugs.python.org/issue1198569

``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``.
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).
Copy link
Member

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."

Copy link
Member Author

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.

@bedevere-bot
Copy link

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 I didn't expect the Spanish Inquisition!. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@warsaw warsaw merged commit ba42796 into python:master Sep 4, 2017
@warsaw warsaw deleted the bpo-1198569 branch September 4, 2017 20:32
GadgetSteve pushed a commit to GadgetSteve/cpython that referenced this pull request Sep 10, 2017
…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``.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants