3 ms·
Every language should have robust, standard collections functions like Python does. Once you start doing quick things with lists like the zip function, or list
by thehappypm 6y ago
Every language should have robust, standard collections functions like Python does. Once you start doing quick things with lists like the zip function, or list comprehensions, it's hard to go back.
- p0llard 6y ago> Once you start doing quick things with lists like the zip function, or list comprehensions, it's hard to go back. Totally agree with you on this one, but I'm not sure I'd go so far as to say that they're a defining feature of Python, more of functional languages, from which Python has borrowed a thing or two.
- thehappypm 6y agoAgreed! Python is just one example of a language that does it well.
- tdeck 6y agoPersonally I think Ruby does a much nicer job of this, although I use both languages on a regular basis. A complx chain of map and filter calls tends to be a lot more readable than a complex nested list comprehension.
- ghj 6y agoPython collections doesn't have basic data structures like red black trees (which are in java as java.util.TreeMap or c++ as std::map). You end up needing third party libraries like sortedcontainers.