-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Description
hyperlink does not support dictionaries for query. while i know that technically this is an orderedmultidict, this is just not nice from an api perspective:
>>> url = URL.from_text('https://example.org/api/v2')
>>> url.replace(query={'foo': 'bar'})
[...]
ValueError: too many values to unpack (expected 2)instead, this works:
>>> url.replace(query=[('foo', 'bar')])
URL.from_text('https://example.org/api/v2?foo=bar')or using .items():
>>> url.replace(query={'foo': 'bar'}.items())
URL.from_text('https://example.org/api/v2?foo=bar')but tbh none of this looks appealing to me. :)
any reason for the current behaviour?
Metadata
Metadata
Assignees
Labels
No labels