Hacker News new | past | comments | ask | show | jobs | submit login

I can see the argument for pattern matching, but algebraic data types seem entirely out of place. The primary benefit would be type checking and exhaustivity checks: neither of which fit with the dynamic nature of Python.

Functional != Strongly Typed




Argument matching has been discussed, there've been PEPs on that, and they couldn't come up with a satisfactory syntax. And that whatever you try, 'if/elif' statements are just more readable and streamlined than any syntax they've try to come up with.

As to strongly typed. Has anyone considered a strict attribute in python, I wonder? Because I'd love [1] to have compile time type checks for types/variables that I'm worried about.

[1] certainly not at a cost of having to contend with type hierarchies of a strongly typed language.


The regularity of ADTs is nice, too, though tagged unions feel weird in dynamic languages.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: