3 ms·
So "/" actually represents two completely different functions, and to disambiguate between them you inspect the types of the operands. That works OK in statical
by infogulch 10y ago
So "/" actually represents two completely different functions, and to disambiguate between them you inspect the types of the operands. That works OK in statically typed languages, but Python is dynamically typed. There's no way to specify which operator you want without verbosely type-casting before each use.
So Python 3 fixes this by separating the two different functions to use different operators: "/" for Real (float) division, and "//" for integer division. Problem solved.
- khedoros 10y agoI agree with anything that you just said, and that's not the portion of the previous post that I had a problem with. The Python3 disambiguation is a nice way to handle the former ambiguity.
- deleted 10y ago[deleted]