Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Python supports types! https://www.mypy-lang.org/


This seems a bit like saying "JavaScript supports types!" because of typescript.


It's not a separate language, you can just start typing your programs right now.


except nothing enforces your types at run time, you can have typi hints all you want and everyone else cn ignore them


Same exists with laws. And in most languages if I want to avoid the type system and hand you a goldfish instead of an int, I can. It just may take more effort. Other language will blow up too if you hand them strange things. Just like python those languages have ways to verify you're not passing goldfish, You just may need more or less effort to use them


Thats a lot of words for: yeah, you are right


A lot of words for "yes, but all languages have this problem." The amount of effort to break the type system is the only difference.


any type safe lnguage will indeed "blow up" while python just continues and you dont get as much as a warning. you are wrong take the L


Everyone else can ignore every coding guideline your team sets up, that’s why code reviews and managers exist.


Python actually has type safety though, as you can't do `'1' + 1` like in JS (not that a linter wouldn't scream at you). If I hear another "I compile <insert language> so I know it will work, but you can't do that in Python" I'll lose it. Having the compiler not complain that the types match is not effing "testing".


> Having the compiler not complain that the types match is not effing "testing".

It absolutely is - it's just testing at a _very_ low level of correctness, and is not sufficient for testing actual high-level functionality.


Both true. What’s wrong with them?


Types are way more mainstream in the JS ecosystem than they are in the Python ecosystem. If you want a "scripty" language with types, then TypeScript is a reasonable choice.




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

Search: