Replies: 2 comments
-
Sounds like a good idea. We can support both of them. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Here is a branch to test out. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey folks
I was going through your docs here:
https://ada-url.readthedocs.io/en/latest/
and couldn't help but think it would be cool if the URL class had support for Path-like "notation" (from pathlib import Path
)For example, instead of having to do this:
This could be handled simply by the base class:
The output of about_url should be:
http://example.com/about
, the class itself handles the compliance based consistencies & things like stripping / joining of "/" strings etcJust like pathlibs Path obejects.
This could probably also be extended by allowing queries, searches and other api-like url structures to be handled by other operators "&" and "|" for eg
This also get's people used to the idea of working with a URL object, which is typically more helpful when encouraging people to conform to some kind of compliance as it lends itself better to more pythonic code & easier typing
Beta Was this translation helpful? Give feedback.
All reactions