FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(uri): replace `lstrip("mailto:")` with manual prefix removal by max-moser · Pull Request #418 · python-validators/validators · GitHub

Repository navigation

fix(uri): replace lstrip("mailto:") with manual prefix removal - #418

Merged
nandgator merged 1 commit into
python-validators:masterfrom
max-moser:mm/fix-mailto-check
Mar 29, 2025
Merged

nandgator merged 1 commit into
python-validators:masterfrom
max-moser:mm/fix-mailto-check

Conversation

Copy link
Copy Markdown
Contributor

The use of lstrip() here was a bit too aggressive.
For example:

In [1]: "mailto:maximilian.moser@tuwien.ac.at".lstrip("mailto:")
Out[1]: 'ximilian.moser@tuwien.ac.at'

But:

In [2]: "mailto:maximilian.moser@tuwien.ac.at".removeprefix("mailto:")
Out[2]: 'maximilian.moser@tuwien.ac.at'

max-moser changed the title fix(uri): replace lstrip() with removesuffix() fix(uri): replace lstrip() with removeprefix() Mar 18, 2025
max-moser force-pushed the mm/fix-mailto-check branch from 9182503 to dbd9946 Compare March 18, 2025 19:30

d-chris commented Mar 18, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor

@max-moser str.removeprefix was introduced in Python 3.9.

Since the package currently supports Python >=3.8, your PR will introduce an incompatibility.

This comment was marked as outdated.

max-moser force-pushed the mm/fix-mailto-check branch from dbd9946 to 35e6a69 Compare March 19, 2025 21:57
max-moser changed the title fix(uri): replace lstrip() with removeprefix() fix(uri): replace lstrip("mailto:") with manual prefix removal Mar 19, 2025

Copy link
Copy Markdown
Contributor Author

updated the PR to avoid incompatibility.

nandgator added the maintenance PR: Alters existing source code label Mar 29, 2025
* the use of `lstrip()` here was a bit too aggressive
* `removeprefix()` is only available with python 3.9+
nandgator force-pushed the mm/fix-mailto-check branch from 35e6a69 to 1dbbd0c Compare March 29, 2025 05:15
nandgator merged commit d6241fc into python-validators:master Mar 29, 2025
max-moser deleted the mm/fix-mailto-check branch March 29, 2025 07:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance PR: Alters existing source code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL