Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #106965
| Path | csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Ethan Furman <ethan@stoneleaf.us> |
| Newsgroups | comp.lang.python |
| Subject | Re: Enum questions. |
| Date | Wed, 13 Apr 2016 14:13:06 -0700 |
| Lines | 21 |
| Message-ID | <mailman.88.1460581932.15650.python-list@python.org> (permalink) |
| References | <570E1B98.4080904@rece.vub.ac.be> <CAGgTfkPfcwamSgRFH9PwuVV4MGsnDwcZOD1=bS=7z+RWnEP0eg@mail.gmail.com> <nelir9$163$1@ger.gmane.org> <mailman.72.1460555456.15650.python-list@python.org> <878u0htxe5.fsf@elektro.pacujo.net> <570E55F4.3050006@stoneleaf.us> <570EB662.6070803@stoneleaf.us> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de SVC5gRYEQTkmUxjjhVOC4QSzGdXjbN452FapaxngRX/w== |
| Return-Path | <ethan@stoneleaf.us> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.007 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'method.': 0.05; 'raises': 0.07; 'blue': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'oh,': 0.09; 'magic': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'creates': 0.18; 'library': 0.20; 'am,': 0.23; 'header:In-Reply- To:1': 0.24; 'header:User-Agent:1': 0.26; 'mostly': 0.27; '~ethan~': 0.29; 'creating': 0.30; 'point': 0.33; 'class': 0.33; 'something': 0.35; 'but': 0.36; 'possible.': 0.36; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'missing': 0.37; 'green': 0.38; 'names': 0.38; 'turned': 0.38; 'to:addr:python.org': 0.40; 'real': 0.62; 'charset:windows-1252': 0.62; 'skip:n 10': 0.62; 'soon': 0.65; 'ethan': 0.91; 'furman': 0.91 |
| User-Agent | Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
| In-Reply-To | <570E55F4.3050006@stoneleaf.us> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.21 |
| 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> |
| X-Mailman-Original-Message-ID | <570EB662.6070803@stoneleaf.us> |
| X-Mailman-Original-References | <570E1B98.4080904@rece.vub.ac.be> <CAGgTfkPfcwamSgRFH9PwuVV4MGsnDwcZOD1=bS=7z+RWnEP0eg@mail.gmail.com> <nelir9$163$1@ger.gmane.org> <mailman.72.1460555456.15650.python-list@python.org> <878u0htxe5.fsf@elektro.pacujo.net> <570E55F4.3050006@stoneleaf.us> |
| Xref | csiph.com comp.lang.python:106965 |
Show key headers only | View raw
On 04/13/2016 07:21 AM, Ethan Furman wrote: > On 04/13/2016 07:07 AM, Marko Rauhamaa wrote: > >> class Color(enum.Enum): >> red >> blue >> green >> >> >> This last one is to the point but raises a NameError. > > Using the aenum library that last one is possible. It also has > NamedConstant and a metaclass-derived NamedTuple! </shameless plug> Oh, and to keep it mostly safe, the magic that creates the missing names is turned off as soon as something real happens, like creating a property or a method. -- ~Ethan~
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: Enum questions. Grant Edwards <grant.b.edwards@gmail.com> - 2016-04-13 13:50 +0000
Re: Enum questions. Marko Rauhamaa <marko@pacujo.net> - 2016-04-13 17:07 +0300
Re: Enum questions. Ethan Furman <ethan@stoneleaf.us> - 2016-04-13 07:21 -0700
Re: Enum questions. Ethan Furman <ethan@stoneleaf.us> - 2016-04-13 14:13 -0700
csiph-web