"Steven D'Aprano" <st...@pearwood.info> wrote in message news:52562ee3$0$2931$c3e8da3$76491...@news.astraweb.com... > 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