Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-36548: Improve the repr of re flags.#12715

Merged
serhiy-storchaka merged 1 commit into
python:masterpython/cpython:masterfrom
serhiy-storchaka:re-flags-reprserhiy-storchaka/cpython:re-flags-reprCopy head branch name to clipboard
May 31, 2019
Merged

bpo-36548: Improve the repr of re flags.#12715
serhiy-storchaka merged 1 commit into
python:masterpython/cpython:masterfrom
serhiy-storchaka:re-flags-reprserhiy-storchaka/cpython:re-flags-reprCopy head branch name to clipboard

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Apr 7, 2019

Copy link
Copy Markdown
Member

@serhiy-storchaka serhiy-storchaka added the type-feature A feature request or enhancement label Apr 7, 2019
Comment thread Lib/re.py
M = MULTILINE
S = DOTALL
X = VERBOSE
ASCII = A = sre_compile.SRE_FLAG_ASCII # assume ascii "locale"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not related to the issue you are solving (but as you're updating this code anyway):

  • the alignment may be more aesthetically pleasing if the one latter variable was the first here
  • PEP8 recommends using at least 2 whitespace before the inline comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In case of aliases the canonical name is the one that is defined first. We want to use long names.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Some lines are already too long, and using two spaces will make them even longer.

Comment thread Lib/re.py
else:
res = f'~{res}'
return res
__str__ = object.__str__

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As you're adding this line, would it be worth adding a few test cases for it ?

@serhiy-storchaka serhiy-storchaka merged commit 14a0e16 into python:master May 31, 2019
@serhiy-storchaka serhiy-storchaka deleted the re-flags-repr branch May 31, 2019 07:39
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.