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

Do not match string prefix at end of docstring #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

panicgh
Copy link

@panicgh panicgh commented Mar 2, 2022

The original docstring regex removed sequences such as r""" from a docstring regardless if it appeared at the beginning or at the end of the docstring: r"""Simulator""" erroneously becomes Simulato. However, r etc. are string prefixes and do not appear at the end of a string.

Therefore, this commit changes the regex to match string prefixes only at the beginning of the docstring and not at the end.

(Closes #84)

The original docstring regex removed sequences such as `r"""` from a
docstring regardless if it appeared at the beginning or at the end of
the docstring: `r"""Simulator"""` erroneously becomes `Simulato`.
However, `r` etc. are
[string prefixes](https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals)
and do not appear at the end of a string.

Therefore, this commit changes the regex to match string prefixes only
at the beginning of the docstring and not at the end.

(Closes Feneric#84)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

r""" (and other string prefixes) removed from the end of docstrings
1 participant