Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'practice,': 0.07; 'python3': 0.07; 'integers': 0.09; 'thats': 0.09; 'way:': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'thread': 0.14; '24,': 0.16; 'distinct': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'literals': 0.16; 'those,': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'code,': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; '100000': 0.31; 'though.': 0.31; 'equal': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'false': 0.36; 'that,': 0.38; 'skip:u 10': 0.60; 'between': 0.67; 'results': 0.69; '2015': 0.84; 'disagreement': 0.84; 'distinguish': 0.84; 'enumeration': 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=bcokWVYXPajhtkhuhhgy2YV3O+qKEjENHdSN6yKv0RE=; b=R4xNyKVd+UHSKuBTYClHTktgptP5Dlv4dw5ItHWf6un+I4w5P5QSHq9yyoTHQK4cG0 5AF5jBykj3/om8QGXe6d2u6tSQ2Xww4QcaTwhGvW37ejqdpJJ5XNV3L7vbCIsmJAH8Rv 5pXrzZ74eV0Njpen2cGDqy5F2d9/vUcuvApgGxchu3YXrti1Tuob7B9Wo+7atTO+7Sx5 dxu8LvVbsfMDyFcttC0VHD+j0lbP+DInxwi5K2b5/pIDNkcv535SKeb+LyS/sWn3pg2M Uez+jy3Wc4We6Nkk/EoQWY42sTqpR1sDs2vLW0cnqw96tbEMCfPGJZ0VszsYb00qwSMw T66A== MIME-Version: 1.0 X-Received: by 10.224.89.2 with SMTP id c2mr16401388qam.75.1422036229128; Fri, 23 Jan 2015 10:03:49 -0800 (PST) In-Reply-To: <80e55765-89c8-4431-9723-7ea4d2d16d50@googlegroups.com> References: <54ABB88A.7070504@r3dsolutions.com> <54ABC52A.1050507@davea.name> <54ABE383.3020801@r3dsolutions.com> <54AC97D9.4010504@r3dsolutions.com> <54ACAA04.60801@r3dsolutions.com> <54ADC99F.3020405@stoneleaf.us> <54B44A64.7010105@r3dsolutions.com> <54b4aded$0$2738$c3e8da3$76491128@news.astraweb.com> <54B5B486.7080406@r3dsolutions.com> <54B72D32.3090209@r3dsolutions.com> <54B76B0A.7050706@r3dsolutions.com> <80e55765-89c8-4431-9723-7ea4d2d16d50@googlegroups.com> Date: Sat, 24 Jan 2015 05:03:48 +1100 Subject: Re: Comparisons and sorting of a numeric class.... 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422036230 news.xs4all.nl 2849 [2001:888:2000:d::a6]:46242 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:84375 On Sat, Jan 24, 2015 at 4:45 AM, Rustom Mody wrote: > No disagreement with the 'hack' > As for "no use case for equal but distinct tokens" - thats a strange > view given this thread Look at it this way: A classic enumeration has no use-case for equal-but-distinct; this thread doesn't disagree with that, because this thread is not about classic enumerations. In the same way, integers don't have use-cases for equal-but-distinct either, but in practice, you can distinguish between exact literals and the results of computation: rosuav@sikorsky:~$ cat unique_numbers.py x = 100000 y = 100000 z = 99999+1 print(x is y, x is z, y is z) rosuav@sikorsky:~$ python3 unique_numbers.py True False False This is still not good code, though. If you really need to distinguish those, your code is majorly fragile. ChrisA