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-46307: Add string.Template.get_identifiers() method #30493

Merged
merged 5 commits into from Jan 11, 2022

Conversation

benkehoe
Copy link
Contributor

@benkehoe benkehoe commented Jan 9, 2022

Add string.Template.get_identifiers() method that returns the identifiers within the template. By default, raises an error if it encounters an invalid identifier (like substitute()). The keyword-only argument raise_on_invalid can be set to False to ignore invalid identifiers (like safe_substitute()).

https://bugs.python.org/issue46307

Automerge-Triggered-By: GH:warsaw

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@benkehoe

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for the patch!

Since this is your first PR to CPython, you would need to:

@sobolevn sobolevn added the type-feature A feature request or enhancement label Jan 9, 2022
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Copy link
Member

@warsaw warsaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for creating this PR!

Please be sure to update the string module's documentation too!

Lib/string.py Outdated Show resolved Hide resolved
@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 have made the requested changes; please review again. 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.

@benkehoe
Copy link
Contributor Author

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@warsaw: please review the changes made to this pull request.

Doc/library/string.rst Outdated Show resolved Hide resolved
Lib/string.py Show resolved Hide resolved
Lib/test/test_string.py Outdated Show resolved Hide resolved
Lib/test/test_string.py Show resolved Hide resolved
Lib/test/test_string.py Show resolved Hide resolved
@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 have made the requested changes; please review again. 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
Copy link
Member

warsaw commented Jan 11, 2022

@benkehoe Have you signed the CLA?

@benkehoe
Copy link
Contributor Author

Do I need to put .. versionadded:: 3.11 on the new methods? I have signed the CLA. I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@warsaw: please review the changes made to this pull request.

@warsaw
Copy link
Member

warsaw commented Jan 11, 2022

Do I need to put .. versionadded:: 3.11 on the new methods?

Yes, please. Sorry, I should have mentioned that earlier.

@benkehoe
Copy link
Contributor Author

Added the versionadded info to the docs.

Copy link
Member

@warsaw warsaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @benkehoe for working on this! I'm approving it. I've also set CI to run and automerge label, so if that passes, this should land.

@benkehoe
Copy link
Contributor Author

Awesome! Thanks @warsaw for helping me make my first contribution to Python!

@miss-islington
Copy link
Contributor

@benkehoe: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit dce642f into python:main Jan 11, 2022
@warsaw
Copy link
Member

warsaw commented Jan 11, 2022

Well done @benkehoe !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants