Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'key.': 0.07; 'dict': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; "'c'": 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'storing': 0.16; 'url:example': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'needed.': 0.23; 'idea': 0.24; 'pass': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'i.e.': 0.27; 'instead.': 0.27; 'correct': 0.28; 'header:X-Complaints-To:1': 0.28; 'class': 0.29; 'maybe': 0.29; 'to:addr:python-list': 0.33; 'along': 0.35; 'pm,': 0.35; 'subject:?': 0.35; 'received:org': 0.36; 'but': 0.36; 'test': 0.36; 'uses': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'making': 0.64; 'deeply': 0.66; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: cymbalic reference? Date: Wed, 16 Jan 2013 19:30:03 -0500 References: <20130115205604.178fa30eff8ae7155174d900@lavabit.com> <20130116130632.d0fa6835d87a92d04c286284@lavabit.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <20130116130632.d0fa6835d87a92d04c286284@lavabit.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358382627 news.xs4all.nl 6858 [2001:888:2000:d::a6]:52702 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36919 On 1/16/2013 4:06 PM, rh wrote: > My final product uses your suggestions along with one from the other post. > I like the idea of storing the class name as the key. Then no call to globals() > is needed. But I still have to test how that object behaves when it's a key. > i.e. Is it deeply bound? Shallow? Tight? Loose? Not sure which is the correct > term! The only effect on an object of making it a dict key is that it cannot disappear. class C: pass d = {C: 'C'} del C # The name 'C' can no longer be used to access the class # However, the class cannot be deleted because it is in use for c in d: print(c) > So maybe I want {Abc:'http://example.com'} and o = s() instead. Yes, as I suggested. -- Terry Jan Reedy