Closed
Description
>>> url = URL.from_text('https://example.org/api/v2')
>>> str(url)
"URL.from_text('https://example.org/api/v2')"
>>> repr(url)
"URL.from_text('https://example.org/api/v2')"
why is str()
not just the url?
https://example.org/api/v2
the requests
library "stringifies" urls (by design). in practice that means that for instance furl instances can be passed directly. this is not possible with hyperlink
:
>>> from hyperlink import URL
>>> import requests
>>> url = URL.from_text('https://example.org/api/v2')
>>> requests.get(url)
[...]
InvalidSchema: No connection adapters were found for 'URL.from_text('https://example.org/api/v2')'
Metadata
Metadata
Assignees
Labels
No labels