-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
Implement RFC 2396 path segments #474
Comments
Would you prepare a pull request? |
I can give it a shot. I assume you want immutability also on that part so I guess segments will be a tuple and a cached property. Any recommendation before I jump into it? |
Are you talking about My initial thought about the issue was that you are talking about |
OK I didn't know there was a >>> u = URL("https://example.com/foo/bar/baz.html")
>>> u.parts
('/', 'foo', 'bar', 'baz.html') For reference, here is a "correct" implementation, minus immutability: fu = furl("https://example.com/foo/bar/baz.html")
>>> fu.path.segments
['foo', 'bar', 'baz.html'] |
I hear you, Another question is the root segment. Should we explicitly distinguish it? I think yes.
I suggest the empty string for that (as
By this, we can handle What do you think? |
If we go the single object route I would suggest the As for the root segment, I don't see the usage of that. Is there a possibility that we have path segments and no root segment? Could you elaborate about the use cases? |
A relative url has no root segment, e.g. |
|
Currently there is no such thing as segments in yarl, which could be useful when you construct your path from a list and don't want to end up chain creating lots of URL objects with some hacky approach (see #138)
It should also be possible to do:
The text was updated successfully, but these errors were encountered: