3 ms·
The Python typing system is limited compared to what exactly? It already has union types, generics, bounded generics, union types, literal types and structural
by pdhborges 4y ago
The Python typing system is limited compared to what exactly? It already has union types, generics, bounded generics, union types, literal types and structural subtyping.
- pdimitar 4y agoCompare it to Haskell, OCaml and Rust and it looks like a toddler tripping all over itself compared to an adult athlete running at a steady 20km/h. There are libraries in these languages where you can get a compile error if you make a mistake in an SQL statement. Also, Python technically has no typing system to speak of so your comment is kind of strange. Not to mention pattern matching, destructuring and other goodies that improve productivity.
- pdhborges 4y ago> Compare it to Haskell, OCaml and Rust and it looks like a toddler tripping all over itself compared to an adult athlete running at a steady 20km/h. Well that is a pretty tall order. Those languages probably have the most extensive type systems among the languages with significant use. But even so Python's type system has features that some of them don't have: for example Rust doesn't have structural subtyping. > Also, Python technically has no typing system to speak of so your comment is kind of strange. Python PEPs define the typing annotations and the typing rules for each annotation. That for me counts as a type system, despite the fact that there is not built in typechecker and you can run programs that you didn't type check. > Not to mention pattern matching, destructuring and other goodies that improve productivity. Python has pattern matching now: https://peps.python.org/pep-0636/ https://peps.python.org/pep-0636/