Path: csiph.com!news.mixmin.net!weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'binary': 0.05; 'float': 0.05; 'type,': 0.07; 'cc:addr:python-list': 0.09; 'assume': 0.11; 'thu,': 0.15; 'cc:name:python': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'operators,': 0.16; 'operators.': 0.16; 'wrote:': 0.16; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'saying': 0.22; 'either.': 0.22; 'int,': 0.22; 'sep': 0.22; 'programming': 0.22; 'am,': 0.23; 'fit': 0.23; 'header:In-Reply-To:1': 0.24; 'fri,': 0.27; 'message- id:@mail.gmail.com': 0.27; 'arithmetic': 0.29; 'comparison': 0.29; 'operators': 0.29; 'yields': 0.29; 'received:google.com': 0.35; 'but': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'things': 0.38; 'represent': 0.38; 'means': 0.39; 'does': 0.39; 'takes': 0.39; 'different': 0.63; 'home': 0.67; 'sole': 0.76; 'chrisa': 0.84; 'float,': 0.84; 'to:none': 0.91; 'subject:True': 0.93 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=6tGoohvUhTer1K02za0vw1J0jza+AjttWo9YmUPMwfc=; b=MssW0SsbeAiCiT0X26O+AlJ7VJU3pzo5lqDaDAzmBLB/vNt5Qvh0NRzh45H5mne3da KkTGZeSHKotaKNxWEKAWaYCMyv1t2onSnL+dUJXgnwoCstNqUT6PNENlFXCD4CA9L/Ab PrghIcHH/UJRfwKD/4+b3skuEvOr3bFe90dqy5HTQJYDttOhOFXfwHO4Nmj9vbFNS7E5 LdyfUCZgoypqizwtUQ5h5AH1pO0WlvncjbAoe3ETPO0gOztL2LU7YmyamyLN7tG9+soj FIsgV5Hest04hWl9mP/srMdVaWAKWsdJDXhzEMUoudbeJx/AB9+nj8C8TW/XWKxSrcwl mtsw== MIME-Version: 1.0 X-Received: by 10.107.33.81 with SMTP id h78mr8554637ioh.19.1442516262395; Thu, 17 Sep 2015 11:57:42 -0700 (PDT) In-Reply-To: References: <0b949fe0-09b4-46b0-b4ac-a85a9bfebfd5@googlegroups.com> <1442412230.1762717.385286049.20841F36@webmail.messagingengine.com> Date: Fri, 18 Sep 2015 04:57:42 +1000 Subject: Re: True == 1 weirdness From: Chris Angelico Cc: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1442516265 news.xs4all.nl 23800 [2001:888:2000:d::a6]:33888 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96779 On Fri, Sep 18, 2015 at 4:49 AM, Ian Kelly wrote: > On Thu, Sep 17, 2015 at 1:06 AM, Jussi Piitulainen > wrote: >> Ordinary binary operators not only combine things of the same type, they >> also produce a thing of that same type. So 'in' does not fit among them >> either. >> >> I feel it's _more_ at home among comparison operators. (Hm. That's >> 'operator' in a different sense.) > > Comparison operators *are* binary operators. All that "binary" means > is that it takes two arguments. I think what Jussi is saying is that int+int yields int, and float*float yields float, and so on - but even that is true only of the arithmetic operators, and not all of them (int/int -> float in Py3). But generalizing from "arithmetic operators" to "ordinary operators" is a little unfair, unless you assume that the sole purpose of programming is to represent algebra. ChrisA