X Tutup
Skip to content

bpo-47081: Replace "qualifiers" with "quantifiers" in the re module documentation#32028

Merged
serhiy-storchaka merged 2 commits intopython:mainfrom
serhiy-storchaka:re-qualifiers-to-quantifiers
Mar 22, 2022
Merged

bpo-47081: Replace "qualifiers" with "quantifiers" in the re module documentation#32028
serhiy-storchaka merged 2 commits intopython:mainfrom
serhiy-storchaka:re-qualifiers-to-quantifiers

Conversation

@serhiy-storchaka
Copy link
Copy Markdown
Member

@serhiy-storchaka serhiy-storchaka commented Mar 21, 2022

Copy link
Copy Markdown
Contributor

@felixxm felixxm left a comment

Choose a reason for hiding this comment

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

@serhiy-storchaka Thanks 👍

match ``'ct'``.

There are two more repeating qualifiers. The question mark character, ``?``,
There are two more repeating operators or quantifiers. The question mark character, ``?``,
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.

Wrap at 80 chars.

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.

I think that in this case it is better to keep a line slightly longer that 80 characters than split it on two very short lines or reformat the whole paragraph. PEP 8 allows some liberty.

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.

I wrongly assumed that in Python docs (as we do in Django docs) re-wrapping is stricter. TIL. Thanks 👍

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.

Small compromises are possible. If it would be a new text, it would be stricter.

how the regular expressions around them are interpreted.

Repetition qualifiers (``*``, ``+``, ``?``, ``{m,n}``, etc) cannot be
Repetition operators or quantifiers (``*``, ``+``, ``?``, ``{m,n}``, etc) cannot be
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.

Wrap at 80 chars.

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.

It is not PEP 8, but some other PEP for documentation. In any case a common sense is the main principle.


``*?``, ``+?``, ``??``
The ``'*'``, ``'+'``, and ``'?'`` qualifiers are all :dfn:`greedy`; they match
The ``'*'``, ``'+'``, and ``'?'`` quantifiers are all :dfn:`greedy`; they match
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.

Wrap at 80 chars.

@serhiy-storchaka serhiy-storchaka merged commit c6cd3cc into python:main Mar 22, 2022
@serhiy-storchaka serhiy-storchaka deleted the re-qualifiers-to-quantifiers branch March 22, 2022 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

X Tutup