Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.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.023 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'python': 0.08; 'be:': 0.09; 'dict': 0.09; 'am,': 0.12; 'eckhardt': 0.16; 'metaclasses.': 0.16; '\xa0this': 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.18; 'jan': 0.19; 'cc:no real name:2**0': 0.20; 'header:In-Reply- To:1': 0.22; 'somehow': 0.23; 'cc:2**0': 0.24; "i'm": 0.26; 'message-id:@mail.gmail.com': 0.28; 'cc:addr:python.org': 0.29; 'example': 0.29; 'kelly': 0.30; 'yes.': 0.30; 'wondering': 0.32; 'pretty': 0.32; 'fri,': 0.34; 'received:209.85.212': 0.34; 'url:python': 0.36; 'subject:with': 0.36; 'skip:" 10': 0.37; 'received:google.com': 0.37; 'could': 0.37; 'replace': 0.38; 'received:209.85': 0.38; 'url:docs': 0.39; 'url:org': 0.39; 'should': 0.39; 'received:209': 0.40; 'link': 0.63; '2012': 0.67; 'url:datamodel': 0.84; 'url:reference': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=CXLoUZ5nJPnBvReCO7HAiHS+vtcvARYD0RJ3no4f5VA=; b=GHO5aYzdcHxRauN0o5mYSnab0LPJRh0q0xVjYjuhKaPsPmIQrqMdfGoOHonIcJq/QD txfR/bJ3q/QOjLY19Kx1ips81mzgaOdrPejGsHETZ8m0B5k5pl+94t7KI8WtTtKisZOL BOwcM9otODspkOkbgRFb4BN8yXpo/YYKc8mPU= MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Fri, 6 Jan 2012 09:07:24 -0700 Subject: Re: replacing __dict__ with an OrderedDict To: Ulrich Eckhardt Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1325866076 news.xs4all.nl 6841 [2001:888:2000:d::a6]:49283 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18608 On Fri, Jan 6, 2012 at 9:06 AM, Ian Kelly wrote: > On Fri, Jan 6, 2012 at 6:40 AM, Ulrich Eckhardt > wrote: >> Nonetheless, I'm still wondering if I could somehow replace the dict wit= h an >> OrderedDict. > > In Python 3, yes. =A0This is pretty much the entire use case for the new > __prepare__ method of metaclasses. =A0See the "OrderedClass" example at: > http://docs.python.org/py3k/reference/datamodel.html#special-method-names That link should be: http://docs.python.org/py3k/reference/datamodel.html#customizing-class-crea= tion