Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '(even': 0.05; 'subject:Python': 0.06; '21,': 0.07; 'explicit': 0.07; 'float': 0.07; 'exception.': 0.09; 'subject:Why': 0.09; 'cc:addr:python- list': 0.11; "wouldn't": 0.14; 'cleanly': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'magic': 0.16; 'objection': 0.16; 'zero,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'integer': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'yields': 0.31; 'another': 0.32; 'basic': 0.35; 'operations': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'done': 0.36; 'subject:?': 0.36; 'should': 0.36; 'two': 0.37; 'pm,': 0.38; 'expect': 0.39; 'is.': 0.60; 'numbers': 0.61; 'simple': 0.61; 'sum': 0.64; 'results': 0.69; 'special': 0.74; 'float,': 0.84; 'hardly': 0.84; '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=Osqzm6Rrv5KLw+vmt1yXsVXTXx5H5aXZJsuXgUiYbrE=; b=dqJZW4VVkq2v3ZnVXeIHF5tVi7KpHr/7gR/ZsT4F6JEua3SbOhRHajpXehTsW8vIvN 6KaMAuxuu76wf8yGdZFW6cRCrZM2rB/oZsD7AgQA1sC5MdLz+Y1Npglo9caLadmZUC0X DAZw+ASYCPNyRey0vGjyDhnNNdLbOU2iL0FnltnK6gLRGiEY9VB9Mko53bk70TPqfCB6 If861VY0mS32+fgGOP/070ZZmMA1ysydlKdS/3ztwkAny0A+YOw9rQWGwwSaK3p9bfZS vsRo/SMxNS6qqYj9rKWH7g0q4wHcFUh56InMwiLecCypc/kIREZOlXRmAnv+RMk5JEe5 kI2w== MIME-Version: 1.0 X-Received: by 10.58.126.4 with SMTP id mu4mr32806775veb.0.1398055715025; Sun, 20 Apr 2014 21:48:35 -0700 (PDT) In-Reply-To: <535493d4$0$29993$c3e8da3$5496439d@news.astraweb.com> References: <7x8ur1esa5.fsf@ruckus.brouhaha.com> <535493d4$0$29993$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 21 Apr 2014 14:48:34 +1000 Subject: Re: Why Python 3? From: Chris Angelico Cc: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1398055717 news.xs4all.nl 2844 [2001:888:2000:d::a6]:37161 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:70453 On Mon, Apr 21, 2014 at 1:43 PM, Steven D'Aprano wrote: >> Both explicit forms can be done cleanly without empowering the language >> with the magic of int/int->float. > > It's hardly magic, and I really am having difficult in working out > exactly what your objection to it is. Is it really as simple as > "operations on ints should only return ints, like in C"? All other basic arithmetic operations on two numbers of the same type results in another number of that type. You wouldn't expect the product of two Fractions to be a Decimal, nor the sum of two complex numbers be a float (even if it results in an imaginary part of zero, it'll still be a complex: (1+2j) + (2-2j) --> (3+0j) not 3.0). There's just one special case: dividing an integer by an integer yields a float, if and only if you use truediv. It sticks out as an exception. ChrisA