3 ms·
You call that strong typing ? IMHO it is natural that it fails - what did you want as a result? But 1 + 1.0 works in Python - and I just added float to integer
by darkestkhan 14y ago
You call that strong typing ? IMHO it is natural that it fails - what did you want as a result?
But 1 + 1.0 works in Python - and I just added float to integer (integer was implicitly converted to float (given sufficiently large integer such behavior will result in erroneous calculation)), which is contrary to what strong typing is about.
- crazyowl 14y agoThis is true, but if that means python isn't strongly typed, then neither is Java or c++, since they too will convert for you. So, what widely used language is strongly typed then?
- darkestkhan 14y agoAda and Haskell from top of my head.
- reycharles 14y agoYes I do. ()+[] fails too. In javascript: 1+"1" --> "11", []+1 --> "1", null+[] --> "null" etc.