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

> implicit conversion to long integers is still an example of weak typing

No, it's an example of a properly defined integer type. Letting "integers" silently overflow is weak typing. If you explicitly want wraparound arithmetic (by proving bounds for performance or wanting implicit modulo), then explicitly specify int16/int32/int64.



> Letting "integers" silently overflow is weak typing.

"Weak typing" is a broad concept, but that's not one of the ideas that it covers. In any case, Python's conversion of integers to long integers is not transparent. It is an actual change to a different type, which is an example of weak typing.


Python never converts an int to a long. Instead, it may return a long from the result of an operation on an int if that result wouldn't find in an int.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: