"Steven D'Aprano" <[email protected]> wrote in message news:[email protected]... > Just came across this little Javascript gem: > > ",,," == Array((null,'cool',false,NaN,4)); > > => evaluates as true > > http://wtfjs.com/2011/02/11/all-your-commas-are-belong-to-Array > > I swear, I am never going to complain about Python again. >
I am sure you know this, but for the record, Javascript has two equality operators, '==' and '==='. The double form attempts to coerce the left and right sides to the same type, the triple form does not. '1' == 1 returns true '1' === 1 returns false The moment I discovered this, I changed all my operators from the double form to the triple form. Now I no longer have surprises of this nature. Frank Millman -- https://mail.python.org/mailman/listinfo/python-list
