Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #84380

Re: Comparisons and sorting of a numeric class....

Return-Path <ian.g.kelly@gmail.com>
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> <CAPTjJmpktyHfghEr+cjPrhso7JgB4VfS4=5Gdi95gT0aFbSYGA@mail.gmail.com> <54AC97D9.4010504@r3dsolutions.com> <CAPTjJmooTK_+HVoeyeSrqBHN1=YjRYQ2kfDyQtL9JoA9SbTqsQ@mail.gmail.com> <54ACAA04.60801@r3dsolutions.com> <54ADC99F.3020405@stoneleaf.us> <54B44A64.7010105@r3dsolutions.com> <CAPTjJmr0Bqcyj=VBADVSthSZ+pYMXQeNC-j8qLC2xHAVLUmcgA@mail.gmail.com> <mailman.17650.1421114374.18130.python-list@python.org> <54b4aded$0$2738$c3e8da3$76491128@news.astraweb.com> <54B5B486.7080406@r3dsolutions.com> <CALwzidn4t_mVvtUjucKwPLzeq5pgFdYDBLjePMeuEEB7gTvKCQ@mail.gmail.com> <54B72D32.3090209@r3dsolutions.com> <CALwzidmn-WJVMxXmRK=dSw0vWoBLf=rZ-6VhXinQhfn3BjF=TQ@mail.gmail.com> <54B76B0A.7050706@r3dsolutions.com> <CALwzid=oTdoMPR+zTOiWOv0HWawYwD=Q6xHusywHPQaJmKOtiA@mail.gmail.com> <mailman.18030.1422013652.18130.python-list@python.org> <bad017ab-490f-4daa-a552-33591c559398@googlegroups.com> <mailman.18039.1422031903.18130.python-list@python.org> <bb5f6854-5ae9-48e5-bb89-4870a552a00f@googlegroups.com> <mailman.18044.1422034655.18130.python-list@python.org> <80e55765-89c8-4431-9723-7ea4d2d16d50@googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Fri, 23 Jan 2015 11:13:26 -0700
Subject Re: Comparisons and sorting of a numeric class....
To Python <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 <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.18052.1422036855.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Fri, Jan 23, 2015 at 10:45 AM, Rustom Mody <rustompmody@gmail.com> 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.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Comparisons and sorting of a numeric class.... Andrew Robinson <andrew3@r3dsolutions.com> - 2015-01-12 17:59 -0800
  Re: Comparisons and sorting of a numeric class.... Steven D'Aprano <steve@pearwood.info> - 2015-01-13 05:32 +0000
    Re: Comparisons and sorting of a numeric class.... Chris Angelico <rosuav@gmail.com> - 2015-01-13 17:13 +1100
    Re: Comparisons and sorting of a numeric class.... Terry Reedy <tjreedy@udel.edu> - 2015-01-13 05:49 -0500
      Re: Comparisons and sorting of a numeric class.... Marko Rauhamaa <marko@pacujo.net> - 2015-01-13 13:00 +0200
        Re: Comparisons and sorting of a numeric class.... Chris Angelico <rosuav@gmail.com> - 2015-01-13 22:20 +1100
        Re: Comparisons and sorting of a numeric class.... Ian Kelly <ian.g.kelly@gmail.com> - 2015-01-13 11:56 -0700
        Re: Comparisons and sorting of a numeric class.... Chris Angelico <rosuav@gmail.com> - 2015-01-14 06:02 +1100
    Re: Comparisons and sorting of a numeric class.... Chris Angelico <rosuav@gmail.com> - 2015-01-13 21:56 +1100
    Re: Comparisons and sorting of a numeric class.... Andrew Robinson <andrew3@r3dsolutions.com> - 2015-01-13 16:12 -0800
    Re: Comparisons and sorting of a numeric class.... Ian Kelly <ian.g.kelly@gmail.com> - 2015-01-14 01:31 -0700
    Re: Comparisons and sorting of a numeric class.... Ian Kelly <ian.g.kelly@gmail.com> - 2015-01-14 22:26 -0700
      Re: Comparisons and sorting of a numeric class.... Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-01-16 22:23 +1300
    Re: Comparisons and sorting of a numeric class.... Andrew Robinson <andrew3@r3dsolutions.com> - 2015-01-14 23:23 -0800
      Re: Comparisons and sorting of a numeric class.... Steven D'Aprano <steve@pearwood.info> - 2015-01-15 08:41 +0000
        Re: Comparisons and sorting of a numeric class.... Andrew Robinson <andrew3@r3dsolutions.com> - 2015-01-15 17:45 -0800
          Re: Comparisons and sorting of a numeric class.... Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-16 18:33 +1100
          Re: Comparisons and sorting of a numeric class.... Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-01-17 00:07 +1300
          Re: Comparisons and sorting of a numeric class.... Rustom Mody <rustompmody@gmail.com> - 2015-01-16 03:22 -0800
          Re: Comparisons and sorting of a numeric class.... Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-17 23:27 +1100
        Re: Comparisons and sorting of a numeric class.... Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-01-16 02:27 +0000
        Re: Comparisons and sorting of a numeric class.... Ian Kelly <ian.g.kelly@gmail.com> - 2015-01-15 22:01 -0700
        Re: Comparisons and sorting of a numeric class.... Chris Angelico <rosuav@gmail.com> - 2015-01-16 17:58 +1100
      Re: Comparisons and sorting of a numeric class.... Rob Gaddi <rgaddi@technologyhighland.invalid> - 2015-01-15 09:54 -0800
        Re: Comparisons and sorting of a numeric class.... Andrew Robinson <andrew3@r3dsolutions.com> - 2015-01-26 15:47 -0800
        Re: Comparisons and sorting of a numeric class.... Ian Kelly <ian.g.kelly@gmail.com> - 2015-01-26 18:50 -0700
    Re: Comparisons and sorting of a numeric class.... Ian Kelly <ian.g.kelly@gmail.com> - 2015-01-15 10:05 -0700
    Re: Comparisons and sorting of a numeric class.... Andrew Robinson <andrew3@r3dsolutions.com> - 2015-01-23 03:46 -0800
      Re: Comparisons and sorting of a numeric class.... Rustom Mody <rustompmody@gmail.com> - 2015-01-23 07:31 -0800
        Re: Comparisons and sorting of a numeric class.... Ian Kelly <ian.g.kelly@gmail.com> - 2015-01-23 09:50 -0700
          Re: Comparisons and sorting of a numeric class.... Rustom Mody <rustompmody@gmail.com> - 2015-01-23 09:03 -0800
            Re: Comparisons and sorting of a numeric class.... Chris Angelico <rosuav@gmail.com> - 2015-01-24 04:23 +1100
              Re: Comparisons and sorting of a numeric class.... Rustom Mody <rustompmody@gmail.com> - 2015-01-23 09:29 -0800
            Re: Comparisons and sorting of a numeric class.... Ian Kelly <ian.g.kelly@gmail.com> - 2015-01-23 11:04 -0700
              Re: Comparisons and sorting of a numeric class.... Rustom Mody <rustompmody@gmail.com> - 2015-01-23 19:13 -0800
              Re: Comparisons and sorting of a numeric class.... Rustom Mody <rustompmody@gmail.com> - 2015-01-23 19:21 -0800
            Re: Comparisons and sorting of a numeric class.... Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-24 16:01 +1100
              Re: Comparisons and sorting of a numeric class.... Chris Angelico <rosuav@gmail.com> - 2015-01-24 16:43 +1100
          Re: Comparisons and sorting of a numeric class.... Rustom Mody <rustompmody@gmail.com> - 2015-01-23 09:22 -0800
            Re: Comparisons and sorting of a numeric class.... Chris Angelico <rosuav@gmail.com> - 2015-01-24 04:37 +1100
              Re: Comparisons and sorting of a numeric class.... Rustom Mody <rustompmody@gmail.com> - 2015-01-23 09:45 -0800
                Re: Comparisons and sorting of a numeric class.... Chris Angelico <rosuav@gmail.com> - 2015-01-24 05:03 +1100
                Re: Comparisons and sorting of a numeric class.... Ian Kelly <ian.g.kelly@gmail.com> - 2015-01-23 11:13 -0700
      Re: Comparisons and sorting of a numeric class.... Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-24 19:27 +1100
    Re: Comparisons and sorting of a numeric class.... Chris Angelico <rosuav@gmail.com> - 2015-01-23 22:58 +1100
    Re: Comparisons and sorting of a numeric class.... Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-01-23 12:07 +0000
    Re: Comparisons and sorting of a numeric class.... Terry Reedy <tjreedy@udel.edu> - 2015-01-23 11:17 -0500
    Re: Comparisons and sorting of a numeric class.... Ian Kelly <ian.g.kelly@gmail.com> - 2015-01-23 11:00 -0700

csiph-web