Java was a lot more concerned with being consistent with C, but in Java where a boolean is called for you have to actually supply a boolean.
It's one of those rare features that I wish other languages would adopt from Java. Possibly the only one. :/
It's one of those rare features that I wish other languages would adopt from Java. Possibly the only one. :/
especially in the case of modulo, it often makes sense to just treat the result like a boolean, because it practically says "divisible yes/no".
theres nothing i remotely like about java and its great that python isnt trying to be like java, but those are just opinions.
is your complaint about the implicit typecast or about the fact that integer can be cast to boolean at all? if its the former then python is just less pointlessly verbose than java. the latter may make sense to complain about.