Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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; 'subject:Python': 0.06; 'element': 0.07; '"c"': 0.09; '"r"': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; '(it': 0.16; 'considers': 0.16; 'losing': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'roy': 0.16; 'language': 0.16; 'thu,': 0.19; '>>>': 0.22; 'exists': 0.24; 'url:home': 0.24; "i've": 0.25; 'header:X -Complaints-To:1': 0.27; "doesn't": 0.30; '"",': 0.31; '>>>>': 0.31; 'equality': 0.31; 'file': 0.32; '(most': 0.33; 'maybe': 0.34; "can't": 0.35; 'display': 0.35; 'convert': 0.35; 'equal': 0.35; 'but': 0.35; 'charset:us-ascii': 0.36; 'should': 0.36; 'to:addr:python-list': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'above,': 0.60; 'information': 0.63; 'real': 0.63; 'more': 0.64; 'smith': 0.68; 'received:108': 0.93; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: I am never going to complain about Python again Date: Thu, 10 Oct 2013 20:09:55 -0400 Organization: IISS Elusive Unicorn References: <52562ee3$0$2931$c3e8da3$76491128@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-73-117-141.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381450201 news.xs4all.nl 15951 [2001:888:2000:d::a6]:41755 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56623 On Thu, 10 Oct 2013 09:09:42 -0400, Roy Smith declaimed the following: >BTW, here's a Python equality oddity: > >>>> r = 0.0 >>>> c = 0 + 0j >>>> r == c >True >>>> int(r) == int(c) >Traceback (most recent call last): > File "", line 1, in >TypeError: can't convert complex to int > >If x == y, then f(x) should also equal f(y). More specifically, if x == >y, and x is in the domain of f(), then y should also be in the domain of >f(). But the int(c) is a downgrade -- it would require losing all information that the item was an element of the complex plain... >>> r = 0.0 >>> c = 0 + 0j >>> r 0.0 >>> c 0j >>> complex(r) == c True >>> Maybe some language exists that considers "c" to be a downgradable match to "r" (it may even be some language I've used -- but never had to consider the condition prior). Note that in the above, the representation of "c" doesn't even display a real component! -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/