Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #56611
| Path | csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <cameron@cskk.homeip.net> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'operator': 0.03; 'mrab': 0.05; 'subject:Python': 0.06; 'binary': 0.07; '"if': 0.09; '*is*': 0.09; 'appropriate.': 0.09; 'mixed': 0.09; 'operand': 0.09; 'python': 0.11; 'directive': 0.16; 'footnote': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'operands': 0.16; 'other,': 0.16; 'received:211.29': 0.16; 'received:211.29.132': 0.16; 'received:cskk.homeip.net': 0.16; 'received:homeip.net': 0.16; 'received:optusnet.com.au': 0.16; 'received:syd.optusnet.com.au': 0.16; 'rule.': 0.16; 'simpson': 0.16; 'types,': 0.16; 'wrote:': 0.18; 'unlike': 0.19; 'header :User-Agent:1': 0.23; 'integer': 0.24; 'test.': 0.24; 'cheers,': 0.24; 'compare': 0.26; 'header:In-Reply-To:1': 0.27; '[2]': 0.30; 'apparently': 0.31; 'forces': 0.31; 'guess': 0.33; 'convert': 0.35; 'equal': 0.35; 'good.': 0.35; 'received:com.au': 0.36; 'received:211': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; 'read': 0.60; 'numbers': 0.61; 'content-disposition:inline': 0.62; 'real': 0.63; 'different': 0.65; 'life': 0.66; 'between': 0.67; 'watching': 0.68; 'paper': 0.75; 'ending': 0.78 |
| Date | Fri, 11 Oct 2013 08:52:43 +1100 |
| From | Cameron Simpson <cs@zip.com.au> |
| To | python-list@python.org |
| Subject | Re: I am never going to complain about Python again |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Disposition | inline |
| Content-Transfer-Encoding | 8bit |
| In-Reply-To | <bbo7j0Fbp3qU1@mid.individual.net> |
| User-Agent | Mutt/1.5.21 (2010-09-15) |
| References | <bbo7j0Fbp3qU1@mid.individual.net> |
| X-Optus-CM-Score | 0 |
| X-Optus-CM-Analysis | v=2.1 cv=YYGEuWhf c=1 sm=1 tr=0 a=YuQlxtEQCowy2cfE5kc7TA==:117 a=YuQlxtEQCowy2cfE5kc7TA==:17 a=ZtCCktOnAAAA:8 a=PO7r1zJSAAAA:8 a=LcaDllckn3IA:10 a=9Lj92nWf6HwA:10 a=IkcTkHD0fZMA:10 a=vrnE16BAAAAA:8 a=8AHkEIZyAAAA:8 a=_Q_BDBVkwOwA:10 a=EBOSESyhAAAA:8 a=1u90lQbei-_3ok55YOkA:9 a=QEXdDO2ut3YA:10 |
| 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.963.1381443400.18130.python-list@python.org> (permalink) |
| Lines | 36 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1381443400 news.xs4all.nl 15943 [2001:888:2000:d::a6]:60273 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:56611 |
Show key headers only | View raw
On 10Oct2013 17:48, Neil Cerutti <neilc@norwich.edu> wrote: > On 2013-10-10, MRAB <python@mrabarnett.plus.com> wrote: > > If r is real (float) and c is complex: > > r == c means r == c.real and c.imag == 0.0 > > Woah. I thought I was going by what the docs say: > > Python fully supports mixed arithmetic: when a binary > arithmetic operator has operands of different numeric types, > the operand with the “narrower” type is widened to that of the > other, where integer is narrower than floating point, which is > narrower than complex. Comparisons between numbers of mixed > type use the same rule. [2] The constructors int(), float(), > and complex() can be used to produce numbers of a specific > type. > > [...] > > [2] Not for complex numbers. Instead convert to floats using > abs() if appropriate. > > I guess the "if appropriate" part eluded my eye. When *is* it > appropriate? Apparently not during an equal test. I must say that I read the footnote [2] as a directive to the programmer. "If you need to do this, a good way is to compare magnitudes is appropriate." Cheers, -- Cameron Simpson <cs@zip.com.au> My life is a never ending battle for the forces of good. Unfortunately, unlike many other crusaders for righteousness, in my system of morality, the right thing to do is very often to sit around reading the paper or watching TV. - Tim_Mefford <tim@physics.orst.edu>
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