Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: Enum questions. Date: Wed, 13 Apr 2016 13:50:33 +0000 (UTC) Lines: 29 Message-ID: References: <570E1B98.4080904@rece.vub.ac.be> X-Trace: news.uni-berlin.de 7a9riTKZqtx488MdB+KF2wffy/4CiO8TPco2swK0F8kQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'value,': 0.03; 'corresponds': 0.09; 'enum': 0.09; 'iterate': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:qwest.net': 0.09; 'tab': 0.09; 'wed,': 0.15; 'iteration.': 0.16; 'missing?': 0.16; 'ordinal': 0.16; 'programmer,': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'pascal': 0.22; 'seems': 0.23; 'header:User- Agent:1': 0.26; "doesn't": 0.26; 'header:X-Complaints-To:1': 0.26; 'values': 0.28; '13,': 0.29; 'coded': 0.29; 'michael': 0.33; 'surprised': 0.33; 'important.': 0.35; 'too': 0.36; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'two': 0.37; 'received:org': 0.37; 'missing': 0.37; 'data': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'today,': 0.62; 'skip:n 10': 0.62; 'between': 0.65; 'miss': 0.77; 'photo': 0.81; 'framed': 0.84; 'hunter': 0.84; 'pardon': 0.84; 'edwards': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: 67-130-15-94.dia.static.qwest.net User-Agent: slrn/1.0.2 (Linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <570E1B98.4080904@rece.vub.ac.be> Xref: csiph.com comp.lang.python:106941 On 2016-04-13, Michael Selik wrote: > On Wed, Apr 13, 2016, 12:14 PM Antoon Pardon wrote: > >> I have been looking at the enum documentation and it seems enums >> are missing two features I rather find important. >> >> 1) Given an Enum value, someway to get the next/previous >> one >> >> 2) Given two Enum values, iterate over the values between >> them. >> >> Did I miss those in the documentation or are they really missing? > > An Enum corresponds to "nominal" data that is coded as a number > simply for storage rather than meaning. FWIW, as an old Pascal programmer, I too would have been surprised that an "enum" is not ordinal and doesn't support a next/prev and iteration. As an old C programmer, not so much. :) -- Grant Edwards grant.b.edwards Yow! Today, THREE WINOS at from DETROIT sold me a gmail.com framed photo of TAB HUNTER before his MAKEOVER!