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

> Please, no. I'm bitten by this in Python every other day,

If you don't know whether your variables contain strings or numbers you literally don't know what your are doing.

> with its otherwise weak typing.

Python is strongly typed.

> It is being more pedantic than Java by doing this.

That just means that Java is broken in that respect.

> Thank you for trying to save my back from unwanted implicit type casts

Making '"1" + 2 = "1twee"' work does not just require a type cast. You actually have to choose and generate one of the string representations of II.

> This never caught a real error

Yes, it did. You tried to concatenate a string with a number. That cannot be done.

> Thank you for trying to save my back from unwanted implicit type casts, but provide me with static typing instead if you want to do so, and fail at compile time.

Python is too dynamic for that to work. However Mypy works well enough to be useful.



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

Search: