Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!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.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'to:addr:comp.lang.python': 0.09; 'from:addr:miki.tebeka': 0.16; 'from:name:miki tebeka': 0.16; 'subject:package': 0.16; 'cc:addr:python-list': 0.16; 'instance': 0.18; 'subject:problem': 0.19; 'seems': 0.20; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'cc:2**0': 0.26; 'code': 0.26; 'work.': 0.27; 'import': 0.27; 'tried': 0.27; 'pass': 0.29; 'class': 0.29; 'cc:addr:python.org': 0.29; "i've": 0.32; 'does': 0.32; 'header:User-Agent:1': 0.33; 'shows': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'some': 0.38; 'received:209': 0.39; 'below': 0.62 Newsgroups: comp.lang.python Date: Mon, 13 Feb 2012 09:18:16 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=75.82.8.111; posting-account=uo-8fwoAAACKsFzFX78JHudx1V7WDXZ0 References: User-Agent: G2/1.0 X-Google-Web-Client: true MIME-Version: 1.0 Subject: Re: package extension problem From: Miki Tebeka To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 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: , Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1329153506 news.xs4all.nl 6851 [2001:888:2000:d::a6]:56333 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20352 > B[some_hash] still returns an instance of the old class A, while I want an instance of the new class A. I don't understand this sentence. How does B[some_hash] related to A? I've tried the below and it seems to work. Can you paste some code to help us understand more? -- old.py -- class A: pass -- new.py __ import old class A(old.A): pass -- main.py -- import new a = new.A() a.__class__ # Shows new.A