Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.05; 'e.g.,': 0.07; 'enum': 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; 'subclass': 0.09; 'wrote:': 0.16; 'defined': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; '~ethan~': 0.29; 'creating': 0.32; 'implement': 0.32; 'subject:?': 0.34; 'to:addr:python-list': 0.35; 'jason': 0.35; 'subject:" ': 0.36; 'received:10': 0.37; "didn't": 0.37; 'subject:: ': 0.37; 'correctly': 0.37; 'pm,': 0.39; 'to:addr:python.org': 0.39; 'received:10.1.10': 0.84 Date: Fri, 29 May 2015 14:44:07 -0700 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: What is considered an "advanced" topic in Python? References: <33b7ab62-8cc2-4a27-b229-64c94bce16b6@googlegroups.com> <656488c4-e706-4fea-ab45-3d1454e35a7f@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1432935863 news.xs4all.nl 2950 [2001:888:2000:d::a6]:50108 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 2902 X-Received-Body-CRC: 3495210429 Xref: csiph.com comp.lang.python:91505 On 05/29/2015 02:28 PM, Jason Swails wrote: > ​[...] e.g., if the person creating an Enum subclass didn't bother to correctly > implement [...] __iter__, and __len__ for their subclass For __iter__ and __len__ to work on the Enum /class/ it must be defined in the metaclass. -- ~Ethan~