3 ms·
> Why the one would write functional code in a language that ain’t very good with maps and filters, has no lazy calculations and has no constants on language de
by dragonwriter 5y ago
> Why the one would write functional code in a language that ain’t very good with maps and filters, has no lazy calculations and has no constants on language design level?
Python is fine with maps and filters, and has lazy calculations.
- impoppy 5y agoPlease provide links so I can read on this
- muxator 5y agoThe map() function is already lazy (in python 3 it returns a generator, and not a materialized list). You can also have a look at "generator expressions", which are the lazy counterpart to a list comprehension (hint: use " ()" instead of "[]").
- dragonwriter 5y ago> Please provide links so I can read on this https://docs.python.org/3/library/functions.html#map https://docs.python.org/3/library/functions.html#map https://docs.python.org/3/library/functions.html#filter https://docs.python.org/3/library/functions.html#filter https://docs.python.org/3/howto/functional.html https://docs.python.org/3/howto/functional.html