Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #56561
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.012 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.06; 'string': 0.09; '===': 0.09; 'converted': 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; '"""if': 0.16; 'coerced': 0.16; '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; 'wrote:': 0.18; 'trying': 0.19; 'numerical': 0.19; '>>>': 0.22; 'example.': 0.24; 'url:02': 0.24; 'compare': 0.26; 'header:X -Complaints-To:1': 0.27; '[1]': 0.29; 'cells': 0.31; 'comparison': 0.31; 'equality': 0.31; 'steven': 0.31; 'not.': 0.33; 'received:co.za': 0.34; 'received:za': 0.34; 'but': 0.35; 'there': 0.35; 'false': 0.36; 'programming,': 0.36; 'two': 0.37; 'to:addr :python-list': 0.38; 'little': 0.38; 'explain': 0.39; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'course.': 0.60; 'skip:a 30': 0.61; 'numbers': 0.61; 'skip:n 10': 0.64; 'linked': 0.65; 'brain': 0.68; 'frank': 0.68; 'url:11': 0.68; 'received:41': 0.70; 'to,': 0.72; 'url:2011': 0.75; 'article': 0.77; 'eyes': 0.78; 'skip:n 40': 0.81; "else's": 0.84; 'url:php': 0.85 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | "Frank Millman" <frank@chagford.com> |
| Subject | Re: I am never going to complain about Python again |
| Date | Thu, 10 Oct 2013 13:44:57 +0200 |
| References | <52562ee3$0$2931$c3e8da3$76491128@news.astraweb.com> <l35o52$e68$1@ger.gmane.org> <52568B30.8040905@mrabarnett.plus.com> |
| X-Gmane-NNTP-Posting-Host | 41-135-99-70.dsl.mweb.co.za |
| X-MSMail-Priority | Normal |
| X-Newsreader | Microsoft Outlook Express 6.00.3790.4657 |
| X-RFC2646 | Format=Flowed; Response |
| 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 <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.935.1381405510.18130.python-list@python.org> (permalink) |
| Lines | 55 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1381405510 news.xs4all.nl 15867 [2001:888:2000:d::a6]:58245 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:56561 |
Show key headers only | View raw
"MRAB" <python@mrabarnett.plus.com> wrote in message news:52568B30.8040905@mrabarnett.plus.com... > On 10/10/2013 09:23, Frank Millman wrote: >> >> "Steven D'Aprano" <steve@pearwood.info> 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. >> > Re "==", this page: > > http://php.net/manual/en/language.operators.comparison.php > > states: > > """If you compare a number with a string or the *comparison involves > numerical strings*, then each string is converted to a number and the > comparison performed numerically.""" (emphasis added) > > So they get coerced to numbers if they _look_ like numbers! > I just tested Steven's example. ",,," == Array((null,'cool',false,NaN,4)) evaluates to true ",,," === Array((null,'cool',false,NaN,4)) evaluates to false I did look at the article that Steven linked to, but it made my eyes glaze, so don't ask me to explain it. I am prepared to use up a few brain cells trying to improve my own programming, but not trying to understand someone else's 'wtf' moments! [1] Frank [1] Unless I have to maintain it, of course. I have been there before, and I have some dark memories!
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
I am never going to complain about Python again Steven D'Aprano <steve@pearwood.info> - 2013-10-10 04:36 +0000
Re: I am never going to complain about Python again Chris Angelico <rosuav@gmail.com> - 2013-10-10 15:50 +1100
Re: I am never going to complain about Python again Chris Rebert <clp2@rebertia.com> - 2013-10-09 22:26 -0700
Re: I am never going to complain about Python again Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-10 06:39 +0100
Re: I am never going to complain about Python again Christian Gollwitzer <auriocus@gmx.de> - 2013-10-10 08:41 +0200
Re: I am never going to complain about Python again "Frank Millman" <frank@chagford.com> - 2013-10-10 10:23 +0200
Re: I am never going to complain about Python again MRAB <python@mrabarnett.plus.com> - 2013-10-10 12:10 +0100
Re: I am never going to complain about Python again Tim Chase <python.list@tim.thechases.com> - 2013-10-10 06:43 -0500
Re: I am never going to complain about Python again "Frank Millman" <frank@chagford.com> - 2013-10-10 13:44 +0200
Re: I am never going to complain about Python again Roy Smith <roy@panix.com> - 2013-10-10 09:09 -0400
Re: I am never going to complain about Python again Neil Cerutti <neilc@norwich.edu> - 2013-10-10 15:51 +0000
Re: I am never going to complain about Python again Rotwang <sg552@hotmail.co.uk> - 2013-10-10 16:57 +0100
Re: I am never going to complain about Python again MRAB <python@mrabarnett.plus.com> - 2013-10-10 17:10 +0100
Re: I am never going to complain about Python again Neil Cerutti <neilc@norwich.edu> - 2013-10-10 17:48 +0000
Re: I am never going to complain about Python again Ian Kelly <ian.g.kelly@gmail.com> - 2013-10-10 12:35 -0600
Re: I am never going to complain about Python again Neil Cerutti <neilc@norwich.edu> - 2013-10-10 18:49 +0000
Re: I am never going to complain about Python again Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-10-10 20:47 +0100
Re: I am never going to complain about Python again Neil Cerutti <neilc@norwich.edu> - 2013-10-10 19:54 +0000
Re: I am never going to complain about Python again Cameron Simpson <cs@zip.com.au> - 2013-10-11 08:52 +1100
Re: I am never going to complain about Python again Roy Smith <roy@panix.com> - 2013-10-10 20:07 -0400
Is this the room for an argument? John Ladasky <john_ladasky@sbcglobal.net> - 2013-10-10 21:26 -0700
Re: Is this the room for an argument? Roy Smith <roy@panix.com> - 2013-10-11 09:49 -0400
Re: I am never going to complain about Python again Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-11 02:23 +0000
Re: I am never going to complain about Python again Neil Cerutti <neilc@norwich.edu> - 2013-10-11 12:31 +0000
Re: I am never going to complain about Python again Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-10-10 20:09 -0400
Re: I am never going to complain about Python again Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-11 02:08 +0000
Re: I am never going to complain about Python again Joshua Landau <joshua@landau.ws> - 2013-10-11 09:17 +0100
Re: I am never going to complain about Python again Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-11 09:11 +0000
Re: I am never going to complain about Python again Chris Angelico <rosuav@gmail.com> - 2013-10-11 20:52 +1100
Re: I am never going to complain about Python again Joshua Landau <joshua@landau.ws> - 2013-10-11 17:56 +0100
csiph-web