Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
fredley
on July 3, 2018
|
parent
|
context
|
favorite
| on:
PEP 572: Python assignment expressions has been ac...
I love writing python, but the lack of decent map/reduce/etc. (that are really good in Javascript - the other language I mainly write) hurts. Stuff like your example really feels burdensome and inelegant in comparison.
pxndx
on July 3, 2018
[–]
Python list comprehensions _are_ map/reduce.
dataflow
on July 3, 2018
|
parent
|
next
[–]
I think you mean map/filter.
pxndx
on July 3, 2018
|
root
|
parent
|
next
[–]
Yes, thanks for correcting me.
yxhuvud
on July 3, 2018
|
parent
|
prev
[–]
Sure, but they compose really bad.
vanderZwan
on July 3, 2018
|
root
|
parent
[–]
Why? Just assign to a variable, then do another list comprehension on the next line, no?
yxhuvud
on July 6, 2018
|
root
|
parent
[–]
And that is a pretty sad state of affairs compared to ways that do compose well, like the one in Ruby which you can easily chain.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: