Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #74234
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.009 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'operator': 0.03; 'method.': 0.07; '===': 0.09; 'comments?': 0.09; 'currently,': 0.09; 'logic': 0.09; 'subtle': 0.09; 'cc:addr:python-list': 0.11; '5:00': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'fuzzy': 0.16; 'notation': 0.16; 'operator;': 0.16; 'pockets': 0.16; 'python",': 0.16; 'subject:operators': 0.16; 'thoughts?': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'differ': 0.19; "python's": 0.19; 'saying': 0.22; 'cc:addr:python.org': 0.22; 'creating': 0.23; 'cc:2**0': 0.24; 'define': 0.26; 'posts': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; '"do': 0.31; "d'aprano": 0.31; 'equality': 0.31; 'operators': 0.31; 'really,': 0.31; 'steven': 0.31; 'probably': 0.32; 'another': 0.32; 'everyone': 0.33; 'cases': 0.33; 'received:google.com': 0.35; 'add': 0.35; 'there': 0.35; 'similar': 0.36; 'should': 0.36; 'wrong': 0.37; 'two': 0.37; 'pm,': 0.38; 'how': 0.40; 'problems.': 0.60; 'new': 0.61; "you're": 0.61; 'first': 0.61; 'kind': 0.63; 'skip:n 10': 0.64; 'pick': 0.64; 'different': 0.65; 'surrounding': 0.68; 'safe': 0.72; 'jul': 0.74; 'truth': 0.81; 'confusion.': 0.84; 'fat': 0.84; 'subject:Proposal': 0.91; 'to:none': 0.92 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=7t1KJIZVrf0zR5j/Br3ZHgDSs36qVLLyGG+YjXOffSI=; b=b8b3swkurMFwMuGGxlEyX3xP963GyC+HojJYy+4jAgKF1Qa7IRTUE9jNlGX4LZkZjq A4tsx++4TtPE17Ubflo5JXCdDm0TCraW7dUKTslpSdytbPBKnEdjV9/KFINAwWHGixHD yzsah8c1Pt8R6va9rkLih85ZbCf6VOgoOoZFqVFEgR59SLcY0tKk+MTuYUFKrbarMtgL rYNlQrcsfRQEPbFpQ2Be2pmcuUc8DHwQKu77ANSUPsJSvbhw8R0RNnc2LEtT30KKdQ1U K2aqJODcv/tDBpBC96cY896ysCpsfRy80e070Ar96Q5VZnAbUM3V2iNOmn6Apw9S5Fl0 2J0Q== |
| MIME-Version | 1.0 |
| X-Received | by 10.52.118.99 with SMTP id kl3mr31931818vdb.18.1404890480760; Wed, 09 Jul 2014 00:21:20 -0700 (PDT) |
| In-Reply-To | <53bce8a3$0$2746$c3e8da3$76491128@news.astraweb.com> |
| References | <53bce8a3$0$2746$c3e8da3$76491128@news.astraweb.com> |
| Date | Wed, 9 Jul 2014 17:21:20 +1000 |
| Subject | Re: Proposal: === and !=== operators |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| 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.11675.1404890483.18130.python-list@python.org> (permalink) |
| Lines | 25 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1404890483 news.xs4all.nl 2921 [2001:888:2000:d::a6]:36883 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:74234 |
Show key headers only | View raw
On Wed, Jul 9, 2014 at 5:00 PM, Steven D'Aprano <steve@pearwood.info> wrote: > Thoughts? Comments? First thought: It will just add confusion. Currently, there are small pockets of confusion surrounding the few cases where something's non-reflexive, and there are occasional threads on the subject, like we have now. Adding another pair of equality operators will mean that everyone has to think "Do I want == or ===?", and we just need to look at PHP and ECMAScript to see what happens - people pick the wrong operator and have no end of subtle problems. There will be blog posts around saying "always use === in Python", or "never use === in Python", and everyone will get confused about how Python's === is similar to and/or different from ECMAScript's and/or PHP's, and ultimately, the only people who win out will be those who get paid to write blog posts. I think this is a big fat YAGNI. The two operators will differ in so few situations that you may as well just define a few cases as "x is y or x == y" instead of creating thew new operator; because really, that's all that's happening here. (And the Py3 docs now use that kind of notation to describe 'in'.) If you want fuzzy logic or three-valued truth or anything, you probably know the types of the things you're comparing, so it should be safe to use a method. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Proposal: === and !=== operators Steven D'Aprano <steve@pearwood.info> - 2014-07-09 07:00 +0000
Re: Proposal: === and !=== operators Chris Angelico <rosuav@gmail.com> - 2014-07-09 17:21 +1000
Re: Proposal: === and !=== operators Steven D'Aprano <steve@pearwood.info> - 2014-07-09 09:17 +0000
Re: Proposal: === and !=== operators Rustom Mody <rustompmody@gmail.com> - 2014-07-09 09:20 -0700
Re: Proposal: === and !=== operators Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-09 11:50 -0600
Re: Proposal: === and !=== operators Cameron Simpson <cs@zip.com.au> - 2014-07-10 09:16 +1000
Re: Proposal: === and !=== operators Johannes Bauer <dfnsonfsduifb@gmx.de> - 2014-07-12 13:54 +0200
Re: Proposal: === and !=== operators Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-12 16:35 +0000
Re: Proposal: === and !=== operators Chris Angelico <rosuav@gmail.com> - 2014-07-13 02:54 +1000
Re: Proposal: === and !=== operators Roy Smith <roy@panix.com> - 2014-07-12 16:39 -0400
Re: Proposal: === and !=== operators Johannes Bauer <dfnsonfsduifb@gmx.de> - 2014-07-12 20:14 +0200
Re: Proposal: === and !=== operators Chris Angelico <rosuav@gmail.com> - 2014-07-13 09:01 +1000
Re: Proposal: === and !=== operators Roy Smith <roy@panix.com> - 2014-07-12 19:06 -0400
Re: Proposal: === and !=== operators Chris Angelico <rosuav@gmail.com> - 2014-07-13 09:15 +1000
Re: Proposal: === and !=== operators Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-13 04:48 +0000
Re: Proposal: === and !=== operators Cameron Simpson <cs@zip.com.au> - 2014-07-09 18:17 +1000
Re: Proposal: === and !=== operators Steven D'Aprano <steve@pearwood.info> - 2014-07-09 09:02 +0000
Re: Proposal: === and !=== operators Chris Angelico <rosuav@gmail.com> - 2014-07-09 19:23 +1000
Re: Proposal: === and !=== operators Devin Jeanpierre <jeanpierreda@gmail.com> - 2014-07-09 05:01 -0700
Re: Proposal: === and !=== operators Roy Smith <roy@panix.com> - 2014-07-09 08:27 -0400
Re: Proposal: === and !=== operators Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-09 12:48 +0000
Re: Proposal: === and !=== operators Tim Chase <python.list@tim.thechases.com> - 2014-07-09 13:05 -0500
Re: Proposal: === and !=== operators Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-10 01:10 +0000
Re: Proposal: === and !=== operators Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-09 12:31 -0600
Re: Proposal: === and !=== operators Roy Smith <roy@panix.com> - 2014-07-09 16:47 -0400
Re: Proposal: === and !=== operators Ethan Furman <ethan@stoneleaf.us> - 2014-07-09 05:43 -0700
Re: Proposal: === and !=== operators Robert Kern <robert.kern@gmail.com> - 2014-07-09 16:27 +0100
Re: Proposal: === and !=== operators Alex Burke <alexjeffburke@gmail.com> - 2014-07-10 18:33 +0200
Re: Proposal: === and !=== operators Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-12 03:30 +0000
Re: Proposal: === and !=== operators Alan Bawden <alan@scooby-doo.csail.mit.edu> - 2014-07-12 01:07 -0400
Re: Proposal: === and !=== operators Torsten Bronger <bronger@physik.rwth-aachen.de> - 2014-07-12 08:05 +0200
Re: Proposal: === and !=== operators Torsten Bronger <bronger@physik.rwth-aachen.de> - 2014-07-12 08:14 +0200
Re: Proposal: === and !=== operators Chris Angelico <rosuav@gmail.com> - 2014-07-12 16:06 +1000
Re: Proposal: === and !=== operators Ethan Furman <ethan@stoneleaf.us> - 2014-07-11 23:11 -0700
Re: Proposal: === and !=== operators Chris Angelico <rosuav@gmail.com> - 2014-07-12 16:39 +1000
Re: Proposal: === and !=== operators Marko Rauhamaa <marko@pacujo.net> - 2014-07-12 10:06 +0300
Re: Proposal: === and !=== operators Ethan Furman <ethan@stoneleaf.us> - 2014-07-11 23:53 -0700
Re: Proposal: === and !=== operators Chris Angelico <rosuav@gmail.com> - 2014-07-12 17:25 +1000
Re: Proposal: === and !=== operators Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-12 08:33 +0000
csiph-web