Description
Initial Checks
- I have searched Google & GitHub for similar requests and couldn't find anything
- I have read and followed the docs and still think this feature is missing
Description
A method to correctly join URLs:
>>> a = Url("https://example.com/")
>>> a.join("user/John")
Url('https://example.com/user/John')
>>> a.join("/user/John")
Url('https://example.com/user/John')
>>> a / "user" / "John" # Similar to pathlib's __truediv__? Would be quite neat but may be too confusing?
Url('https://example.com/user/John')
This would be really helpful when dealing with URLs, so you don't have to keep a track of /
on your own.
Affected Components
- Compatibility between releases
- Data validation/parsing
- Data serialization -
.model_dump()
and.model_dump_json()
- JSON Schema
- Dataclasses
- Model Config
- Field Types - adding or changing a particular data type
- Function validation decorator
- Generic Models
- Other Model behaviour -
model_construct()
, pickling, private attributes, ORM mode - Plugins and integration with other tools - mypy, FastAPI, python-devtools, Hypothesis, VS Code, PyCharm, etc.