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-38981: Rename re.error to re.ReCompileError for better readability. #17501

Closed
wants to merge 5 commits into from

Conversation

Carreau
Copy link
Contributor

@Carreau Carreau commented Dec 7, 2019

This is also a name which is pep8 compliant.
Update all the usage in the core to the new spelling.

Keep error alias for backward compatibility

https://bugs.python.org/issue38981

This is also a name which is pep8 compliant.
Update all the usage in the core to the new spelling.

Keep `error` alias for backward compatibility
Copy link
Member

@terryjreedy terryjreedy left a comment

Choose a reason for hiding this comment

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

This was discussed on python-ideas and I believe Guido approved of this specific change as long as the old name were kept as alias. There should be a new test that the alias works.

Lib/re.py Outdated Show resolved Hide resolved
Doc/library/re.rst Outdated Show resolved Hide resolved
Doc/library/re.rst Outdated Show resolved Hide resolved
Lib/re.py Outdated Show resolved Hide resolved
Lib/re.py Outdated Show resolved Hide resolved
Lib/sre_compile.py Outdated Show resolved Hide resolved
Lib/sre_compile.py Outdated Show resolved Hide resolved
Lib/sre_compile.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.

@terryjreedy
Copy link
Member

The test failure is this:

$ make check suspicious html SPHINXOPTS="-q -W -j4"
python3 tools/rstlint.py -i tools -i ./venv -i README.rst
[2] library/re.rst:973: default role used
1 problem with severity 2 found.
Makefile:204: recipe for target 'check' failed
make: *** [check] Error 1

I don't understand 'default role' or why using such is bad. The only markup change is the addition of backticks around 'ReCompileError' on line 973. Maybe this is the error. Perhaps ask about this on core-mentorship list. I do not see error with 'make html' on Windows, so this is doing a more severe test.

Lib/idlelib/replace.py Outdated Show resolved Hide resolved
@terryjreedy terryjreedy requested a review from gpshead December 8, 2019 04:33
Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu>
@Carreau
Copy link
Contributor Author

Carreau commented Dec 8, 2019

I don't understand 'default role' or why using such is bad. The only markup change is the addition of backticks around 'ReCompileError' on line 973. Maybe this is the error.

Yes it likely need to be double backticks. I'll try to do that.

I'll remove the change from idlelib and add a test the alias works.

@@ -965,12 +965,12 @@ form.
Clear the regular expression cache.


.. exception:: error(msg, pattern=None, pos=None)
.. exception:: ReCompileError(msg, pattern=None, pos=None)
Copy link
Member

Choose a reason for hiding this comment

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

We need an explicit index reference for error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how would I add and explicit index reference ? .. error: on top ?

Doc/library/re.rst Outdated Show resolved Hide resolved
Doc/library/re.rst Show resolved Hide resolved
Lib/re.py Outdated Show resolved Hide resolved
Modules/_xxtestfuzz/fuzzer.c Outdated Show resolved Hide resolved
@Carreau
Copy link
Contributor Author

Carreau commented Dec 9, 2019

I didn't expect the Spanish Inquisition

@bedevere-bot
Copy link

Nobody expects the Spanish Inquisition!

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

@Carreau
Copy link
Contributor Author

Carreau commented Dec 9, 2019

One remaining question is the final name of this exception.

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

Successfully merging this pull request may close these issues.

5 participants