3 ms·
Python has Lists (arrays), Dict, and Sets. That's pretty much it. There's no linked lists. There's no sorted maps, no sorted sets, no maps that preserve insert
by mruts 7y ago
Python has Lists (arrays), Dict, and Sets. That's pretty much it.
There's no linked lists. There's no sorted maps, no sorted sets, no maps that preserve insertion order, no queues, no priority queues, no bitsets. And there's no immutable collection in Python besides strings.
Meanwhile, Scala has all of that and more: https://docs.scala-lang.org/overviews/collections/overview.html https://docs.scala-lang.org/overviews/collections/overview.h...
Moreover, scala has synchronized collections that can work over multiple threads. I guess all collections work that way in Python, but that's because Python doesn't even support true thread parallelism in the first place!
Also, if we're talking about the number of methods on the collections, Scala has way way more. map/foreach/filter/foldl/foldr/option/drop/take/first/last etc etc.
- zodiac 7y ago> And there's no immutable collection in Python besides strings frozensets, tuples?