Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.06; '===': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'type,': 0.09; 'python': 0.11; 'wrote': 0.14; 'evaluates': 0.16; 'operators,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'record,': 0.16; 'skip:n 50': 0.16; 'surprises': 0.16; 'url:02': 0.24; 'header:X-Complaints-To:1': 0.27; 'equality': 0.31; 'operators': 0.31; 'not.': 0.33; 'moment': 0.34; 'received:co.za': 0.34; 'received:za': 0.34; 'form.': 0.35; 'but': 0.35; 'false': 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'little': 0.38; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'changed': 0.39; 'received:org': 0.40; 'skip:a 30': 0.61; 'frank': 0.68; 'url:11': 0.68; 'received:41': 0.70; 'url:2011': 0.75; 'discovered': 0.83 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: "Frank Millman" Subject: Re: I am never going to complain about Python again Date: Thu, 10 Oct 2013 10:23:10 +0200 References: <52562ee3$0$2931$c3e8da3$76491128@news.astraweb.com> X-Gmane-NNTP-Posting-Host: 41-133-115-77.dsl.mweb.co.za X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.3790.4657 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4913 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381393400 news.xs4all.nl 15965 [2001:888:2000:d::a6]:52790 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56556 "Steven D'Aprano" wrote in message news:52562ee3$0$2931$c3e8da3$76491128@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