Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'api.': 0.05; 'mess': 0.07; 'suggesting': 0.07; 'python': 0.08; 'builtin': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'essentially': 0.10; 'am,': 0.12; 'doesnt': 0.16; 'hardcoded': 0.16; 'wanted.': 0.16; 'language': 0.17; 'wrote:': 0.18; 'header :In-Reply-To:1': 0.22; 'posted': 0.25; 'code': 0.25; 'answered': 0.29; 'seem': 0.30; 'construct': 0.30; 'kelly': 0.30; 'quite': 0.32; 'actual': 0.32; 'header:User-Agent:1': 0.33; 'actually': 0.33; 'header:X-Complaints-To:1': 0.33; 'there': 0.33; 'to:addr :python-list': 0.34; 'it.': 0.34; 'changing': 0.35; 'post': 0.36; 'received:au': 0.36; 'question': 0.36; 'subject:with': 0.36; 'but': 0.37; 'received:org': 0.38; 'primary': 0.38; 'to:addr:python.org': 0.40; 'custom': 0.61; 'your': 0.61; '09:03': 0.84; 'answered,': 0.84; 'otten': 0.84; 'received:110': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Lie Ryan Subject: Re: replacing __dict__ with an OrderedDict Date: Mon, 09 Jan 2012 23:10:14 +1100 References: <4f079690$0$29966$c3e8da3$5496439d@news.astraweb.com> <10504296-daa3-4c3d-b45a-883af99e6804@z19g2000vbe.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 110-175-240-90.static.tpgi.com.au User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0 In-Reply-To: <10504296-daa3-4c3d-b45a-883af99e6804@z19g2000vbe.googlegroups.com> 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1326111035 news.xs4all.nl 6874 [2001:888:2000:d::a6]:58344 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18706 On 01/09/2012 09:03 AM, Eelco wrote: > i havnt read every post in great detail, but it doesnt seem like your > actual question has been answered, so ill give it a try. > > AFAIK, changing __dict__ to be an ordereddict is fundamentally > impossible in python 2. __dict__ is a builtin language construct > hardcoded into the C API. There is no way to mess with it. > > Apparently this is different in python 3, but I dont know much about > that. Actually the primary question has been answered by Ian Kelly which suggested __prepare__ for Python 3, and Peter Otten posted a code for a custom TestLoader that will essentially do what the OP wanted. I was just suggesting that what the OP thinks he wants is quite likely not what he actually wants.