adding "port" parameter to urllib.parse.urlunparse
Hi. I'm a newbie and Python ideas was recommended to me as a place to go to. I think this is a good idea that have port parameter in "urlunparse" method. (refer to: https://bugs.python.org/issue38408) One way is to add keyword parameters to urlunparse, like: def urlunparse(components, *, username=None, password=None, hostname=None, port=None): Which would be called like this: site_to_test = urllib.parse.urlunparse((scheme, host, page, '', '', ''), port=9097) Another interface would be have all URL parameters passed in as keyword arguments. so you can't pass in both "components" and any other named parameter. Like this: def urlunparse(components=None, scheme=None, netloc=None, path=None, params=None, query=None, fragment=None, *, username=None, password=None, hostname=None, port=None): And then error if components is set and any of other named parameters are also set. My question is which would we prefer?
participants (1)
-
AMIR MOHAMMADI