3 ms·
I don't know, it doesn't seem very far form the python version: values = ( key_value.partition('=')[-1] for key_value in s.partiti
by BiteCode_dev 4y ago
I don't know, it doesn't seem very far form the python version:
values = (
key_value.partition('=')[-1]
for key_value in
s.partition('?')[-1].split('&')
)
- oriolid 4y agoThis is already showing why the the Python list/iterator comprehension syntax isn't great. The part "s.partition('?')[-1].split('&')" reads from left to right, and then the rest is read from end to beginning. It gets even more confusing with nested comprehensions. In my opinion both the dotted pipeline style and the Lisp style where you always start from the deepest nesting level are both more readable than Python's approach with sometimes from left to right, sometimes from right to left and sometimes from middle out.