GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-105687: Remove deprecated objects from `re` module by sobolevn · Pull Request #105688 · python/cpython

Conversation

@sobolevn

@sobolevn sobolevn commented Jun 12, 2023 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Remove deprecated re.template, re.T, re.TEMPLATE #105687

📚 Documentation preview 📚: https://cpython-previews--105688.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sobolevn
pythongh-105687: Remove deprecated objects from re module
4ba114b
@sobolevn
sobolevn requested a review from serhiy-storchaka June 12, 2023 12:18
@bedevere-bot bedevere-bot added the awaiting review label Jun 12, 2023
@bedevere-bot bedevere-bot mentioned this pull request Jun 12, 2023
Remove deprecated re.template, re.T, re.TEMPLATE #105687
Closed
@sobolevn
Regen
32d9d1f
@sobolevn
sobolevn requested a review from vstinner June 12, 2023 12:24
@vstinner

vstinner commented Jun 13, 2023

Copy link
Copy Markdown
Member

I already proposed to remove these APIs directly, without deprecation period. But @serhiy-storchaka wanted to collect feedback of users with a deprecation period. So far, I am not aware of any feedback.

This feature can be reimplemented outside Python stdlib if needed, no?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner reviewed Jun 13, 2023
View reviewed changes
Comment thread Doc/whatsnew/3.13.rst Outdated
* Remove deprecated ``re.template`` function
and ``re.T`` and ``re.TEMPLATE`` flags.
Also removes ``SRE_FLAG_TEMPLATE`` constant
from ``sre_constants`` and ``re._constants``.

@vstinner vstinner Jun 13, 2023

Copy link
Copy Markdown
Member

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.

Please explain how to update existing code. I suppose that replacing re.template() with re.compile() works in most cases, no?

Please mention also that the flag never worked, see the previous removal commit.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@serhiy-storchaka serhiy-storchaka Jun 13, 2023

Copy link
Copy Markdown
Member

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 that these who use it should find how to replace it themselves. It cannot just be replaced with re.compile(), otherwise they would use re.compile() at first place. Perhaps.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/whatsnew/3.13.rst Outdated
and ``re.T`` and ``re.TEMPLATE`` flags.
Also removes ``SRE_FLAG_TEMPLATE`` constant
from ``sre_constants`` and ``re._constants``.
(Contributed by Nikita Sobolev in :gh:`105687`.)

@vstinner vstinner Jun 13, 2023

Copy link
Copy Markdown
Member

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.

You might want to credit Serhiy who attempted first to remove it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sobolevn sobolevn Jun 13, 2023

Copy link
Copy Markdown
Member Author

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.

Of course!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sobolevn sobolevn Jun 13, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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 added Serhiy as the first name in the name tuple 👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner

vstinner commented Jun 13, 2023

Copy link
Copy Markdown
Member

cc @hugovk

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

serhiy-storchaka
serhiy-storchaka reviewed Jun 13, 2023
View reviewed changes
Comment thread Doc/whatsnew/3.13.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.13.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.13.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.13.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.13.rst Outdated
* Remove deprecated ``re.template`` function
and ``re.T`` and ``re.TEMPLATE`` flags.
Also removes ``SRE_FLAG_TEMPLATE`` constant
from ``sre_constants`` and ``re._constants``.

@serhiy-storchaka serhiy-storchaka Jun 13, 2023

Copy link
Copy Markdown
Member

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 that these who use it should find how to replace it themselves. It cannot just be replaced with re.compile(), otherwise they would use re.compile() at first place. Perhaps.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@serhiy-storchaka

serhiy-storchaka commented Jun 13, 2023

Copy link
Copy Markdown
Member

I already proposed to remove these APIs directly, without deprecation period. But @serhiy-storchaka wanted to collect feedback of users with a deprecation period.

Actually, I initially removed it without deprecation, because it clearly looked to me as unfinished in process of initial implementation and later broken feature.

My best guess is that it was purposed to make all quntifiers possessive. But initial implementation of atomic groups and possessive quantifiers was broken. Now we have working implementation, and can enable that feature. To disable backtracking it would need also wrap every alternation into atomic group. We can do this now if it was initial purpose, but I have no idea why somebody would need such feature.

sobolevn reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn
Address review
55e0c83
vstinner
vstinner approved these changes Jun 13, 2023
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

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.

LGTM. Thanks for the enhanced doc.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sobolevn reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Jun 13, 2023
serhiy-storchaka
serhiy-storchaka approved these changes Jun 14, 2023
View reviewed changes
@vstinner
vstinner merged commit 67f69db into python:main Jun 14, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Jun 14, 2023
@vstinner

vstinner commented Jun 14, 2023

Copy link
Copy Markdown
Member

Merged, thanks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes
@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@sobolevn @vstinner @serhiy-storchaka @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.