Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.039 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'thats': 0.09; 'jan': 0.12; 'thread': 0.14; '10:45': 0.16; '23,': 0.16; 'compares': 0.16; 'distinct': 0.16; 'enum': 0.16; 'equal.': 0.16; 'unlikely': 0.16; 'wrote:': 0.18; 'example': 0.22; 'planet': 0.24; 'define': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; 'url:python': 0.33; 'fri,': 0.33; 'equal': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'leads': 0.36; 'mass': 0.36; 'method': 0.36; 'url:org': 0.36; 'two': 0.37; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'realize': 0.39; 'to:addr:python.org': 0.39; 'url:3': 0.61; '2015': 0.84; 'disagreement': 0.84; 'fail.': 0.84; 'planets': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=hp1VX7CHhYhLlqqBvAl8c0d3/GNjvPczYq6w8BtbTCA=; b=p7VhfMGyARYZXAYCgHJTkc5lfHozMjcuKE+dCgy9PDbgWr7tkJuuLMX2LpLMR43ezM cWLKwH6wLpfysWpBunbxBOatIowhbVACZpcgIkghKPONLiIuWb9/0+cT3+ap05X5MDKa 4wLu5Yc8jHPUq/2vpxygNBYcmwBbtBm8BEu8nRiFkLJ60wWAhlEjsixRtgHm4O7z8Iip juxa6NSf7tOeXxuBJ9hDXo7a6ELIf4ZTJbpyWC29W8r4+Vt9laYVtnAu83C8yuHfluZ8 5DiNHE+KpmUXfGfLhquE25GOuCcRaixukOUcZPy9465ZurhCpexUiabYS+exwPWgDxia NIMg== X-Received: by 10.68.130.4 with SMTP id oa4mr13246064pbb.95.1422036847528; Fri, 23 Jan 2015 10:14:07 -0800 (PST) MIME-Version: 1.0 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> From: Ian Kelly Date: Fri, 23 Jan 2015 11:13:26 -0700 Subject: Re: Comparisons and sorting of a numeric class.... To: Python 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422036855 news.xs4all.nl 2933 [2001:888:2000:d::a6]:59267 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:84380 On Fri, Jan 23, 2015 at 10: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 If you want equal but distinct, you can give them distinct values and define an __eq__ method that compares them as equal. Because of this though I do take some issue with the Planet example in the docs: https://docs.python.org/3/library/enum.html#planet If any planets happened to have the same mass and radius (which I realize would be unlikely in this case), the example would fail. Using the value of the enum for both identity and data conflates the two concepts and leads to pitfalls.