At least for the contrived example from the article, the solution isn't to break up the code, but to use denser code. Use a regex. Does anybody really think that e.g. sregex[1] is better than just learning and using the regex language directly? Because that's where this kind of thinking leads. [1]: https://github.com/jwiegley/emacs-release/blob/master/lisp/o...
from stdlib:
from urllib.parse import urlparse, parse_qsl
url = 'https://www.example.com/some_pathsome_key=some_value&foo=bar'
parsed_url = urlparse(url)
values = [v for _, v in parse_qsl(parsed_url.query)]
print(values)
which I guess you could oneliner back to this.. [v for _, v in parse_qsl(urlparse(url).query]