3 ms·
If sets were a Python-only thing I'd say that it's too clever, but it's a concept that appears in many other environments: Typescript (unions), Datalog and othe
by williamdclt 5y ago
If sets were a Python-only thing I'd say that it's too clever, but it's a concept that appears in many other environments: Typescript (unions), Datalog and other declarative logic languages, Haskell (I think) and other functional languages...
So python is implementing an existing paradigm, not trying to be clever inventing something new. I'm happy with that
- dec0dedab0de 5y agoit's actually much older than that. https://en.wikipedia.org/wiki/Set_theory https://en.wikipedia.org/wiki/Set_theory
- tgb 5y agoI think you’re confusing sets with another concept. I don’t know much about those other languages you list but I believe python’s typing.Union is more similar to what you list. Sets are just unordered data collections with unique elements.