Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
First one works the same way in pretty much all modern languages with scalar objects (join is a method in the string class, strong typing means you have to explicitly convert your objects to strings before you can pass them to join and a list comprehension is the easiest way to do it (you could use map instead if you want ','.join(map(str, array))
True and False are not variables, they are constants, all built in constants use CamelCase, treating True and False differently would be inconsistent.
as for the NaN check, it isn't that different from PHPs is_nan($x), if the value is expected to be an integer you should check if it is an integer rather than if its not NaN.
NaN is a non computable floating point value with the special property NaN != NaN (Which incidentally makes it fairly easy to check if a value is NaN without using a special function for it , if x != x is True then x is probably NaN)
matanl27873yPatience is your fellow, get used to these minor syntactic changes and you'll love what lies behind
whenever I code in python, I do some perl to clean myself afterwards 😛
same goes for php
beriba9293y@ItsNotMyFault join function is fine but why invoking it on the "glue"? it's completely irrational. it should be something like array.join(glue) or join(array, glue) or even string.join(array,glue) if you want that function in string module.
Why booleans are constants? Most modern languages have them built-in. And if this is a constant what happens if you override it? I believe it's evil
isnan function itself is fine. Even it's placement in math module looks good. But why I need to cast it to float? Because someone represented NaN (which states for Not a Number!) as a special float with irrational property? Wow, that looks consistent
matanl27873y@beriba regarding the join, because you join the array elements and not the glue