Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ethan Furman Newsgroups: comp.lang.python Subject: Re: Enum questions. Date: Wed, 13 Apr 2016 07:21:40 -0700 Lines: 16 Message-ID: References: <570E1B98.4080904@rece.vub.ac.be> <878u0htxe5.fsf@elektro.pacujo.net> <570E55F4.3050006@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 6TnFDwG0FTJTp5uFIbOEkQLukTGxi1z6+5kgd6pqxhJQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '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; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'library': 0.20; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; '~ethan~': 0.29; 'point': 0.33; 'class': 0.33; 'but': 0.36; 'possible.': 0.36; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'green': 0.38; 'to:addr:python.org': 0.40; 'charset:windows-1252': 0.62; 'skip:n 10': 0.62 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: <878u0htxe5.fsf@elektro.pacujo.net> 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: <570E55F4.3050006@stoneleaf.us> X-Mailman-Original-References: <570E1B98.4080904@rece.vub.ac.be> <878u0htxe5.fsf@elektro.pacujo.net> Xref: csiph.com comp.lang.python:106945 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! -- ~Ethan~