Title: Document DecodedURL · Issue #125 · python-hyper/hyperlink · GitHub
Open Graph Title: Document DecodedURL · Issue #125 · python-hyper/hyperlink
X Title: Document DecodedURL · Issue #125 · python-hyper/hyperlink
Description: There don't seem to be API docs for DecodedURL. As far as I can see it's only mentioned in the docstring of hyperlink.parse (which also mentions EncodedURL without explaining that URL is EncodedURL). URL's escaping behavior is inconsiste...
Open Graph Description: There don't seem to be API docs for DecodedURL. As far as I can see it's only mentioned in the docstring of hyperlink.parse (which also mentions EncodedURL without explaining that URL is EncodedURL...
X Description: There don't seem to be API docs for DecodedURL. As far as I can see it's only mentioned in the docstring of hyperlink.parse (which also mentions EncodedURL without explaining that URL is En...
Opengraph URL: https://github.com/python-hyper/hyperlink/issues/125
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Document DecodedURL","articleBody":"There don't seem to be API docs for DecodedURL. As far as I can see it's only mentioned in the docstring of [hyperlink.parse](https://hyperlink.readthedocs.io/en/latest/api.html#hyperlink.parse) (which also mentions `EncodedURL` without explaining that `URL` _is_ `EncodedURL`).\r\n\r\nURL's escaping behavior is inconsistent between path manipulation functions and querystring manipulators. The former escape, while the latter validate input:\r\n\r\n```\r\nPython 3.7.7 (default, Mar 10 2020, 15:16:38) \r\n>>> from hyperlink import URL, DecodedURL\r\n>>> u = URL.from_text('https://example.com')\r\n>>> u.child('foo/bar')\r\nURL.from_text('https://example.com/foo%2Fbar')\r\n>>> u.add('foo', '&')\r\nTraceback (most recent call last):\r\n ...\r\nValueError: one or more reserved delimiters present in query parameter value: '&'\r\n```\r\n\r\nThe documentation of `add()`, `set()`, etc. should at least mention this validation.\r\n\r\n`DecodedURL` has consistent behavior: both escape as required:\r\n\r\n```\r\n>>> du = DecodedURL.from_text('https://example.com')\r\n>>> du.child('foo/bar')\r\nDecodedURL(url=URL.from_text('https://example.com/foo%2Fbar'))\r\n>>> du.add('foo', '&')\r\nDecodedURL(url=URL.from_text('https://example.com/?foo=%26'))\r\n```\r\n\r\nI find this behavior less surprising.","author":{"url":"https://github.com/twm","@type":"Person","name":"twm"},"datePublished":"2020-04-05T23:15:34Z","url":"https://github.com/python-hyper/hyperlink/issues/125"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cab6cdbd-9ba4-f8a9-58fb-a9e982a1b703 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFE2:97034:1DF6AC2:2990272:6B06EBA2 |
| html-safe-nonce | 31ebe9ac6991bd4fd1bf38dab64a4e3b429acdfe46fdcca7b47208171ea8b13c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkUyOjk3MDM0OjFERjZBQzI6Mjk5MDI3Mjo2QjA2RUJBMiIsInZpc2l0b3JfaWQiOiIxOTU1MDAxNDMwNTQ1MTk3OTg2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4cc78d293ab4a2dd205a0b2a8b67eced8fa9ba52d0cc007471f229412bd980df |
| hovercard-subject-tag | issue:594701668 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-hyper/hyperlink/125/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bcdde74a388d11d93b00f7c157383b4e5bdf02518454fb86a61b4e47c59f7b1b/python-hyper/hyperlink/issues/125 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bcdde74a388d11d93b00f7c157383b4e5bdf02518454fb86a61b4e47c59f7b1b/python-hyper/hyperlink/issues/125 |
| og:image:alt | There don't seem to be API docs for DecodedURL. As far as I can see it's only mentioned in the docstring of hyperlink.parse (which also mentions EncodedURL without explaining that URL is EncodedURL... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | twm |
| hostname | github.com |
| expected-hostname | github.com |
| None | 351ea5ca38a5758919d44ee52c70fe9003c0c2dfa20f04effd7fac0c5330c16b |
| turbo-cache-control | no-preview |
| go-import | github.com/python-hyper/hyperlink git https://github.com/python-hyper/hyperlink.git |
| octolytics-dimension-user_id | 13035907 |
| octolytics-dimension-user_login | python-hyper |
| octolytics-dimension-repository_id | 82321340 |
| octolytics-dimension-repository_nwo | python-hyper/hyperlink |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 82321340 |
| octolytics-dimension-repository_network_root_nwo | python-hyper/hyperlink |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | af8913cd0f2f77c41796be449ac66a9108825abc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width