Is your feature request related to a problem?
I love how yarl follows the pathlib.Path syntax, so was a bit disappointed to not have a with_suffix() method when I needed it. Could it be added?
Describe the solution you'd like
Similar to pathlib, with_suffix() should take a URL to a file, like:
url = yarl.URL("https://a.b.com/index.html")
and change it to:
url.with_suffix(".md")
-> https://a.b.com/index.md
Describe alternatives you've considered
with_name() works as a workaround, but it's sometimes cumbersome to fish out the name first, and do string ops on it before adding it back to the URL.
Additional context
No response
Code of Conduct
Is your feature request related to a problem?
I love how yarl follows the pathlib.Path syntax, so was a bit disappointed to not have a
with_suffix()method when I needed it. Could it be added?Describe the solution you'd like
Similar to pathlib,
with_suffix()should take a URL to a file, like:url = yarl.URL("https://a.b.com/index.html")
and change it to:
url.with_suffix(".md")
-> https://a.b.com/index.md
Describe alternatives you've considered
with_name()works as a workaround, but it's sometimes cumbersome to fish out the name first, and do string ops on it before adding it back to the URL.Additional context
No response
Code of Conduct