Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #20352

Re: package extension problem

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 <miki.tebeka@gmail.com>
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 <mailman.5734.1329072778.27778.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=75.82.8.111; posting-account=uo-8fwoAAACKsFzFX78JHudx1V7WDXZ0
References <mailman.5734.1329072778.27778.python-list@python.org>
User-Agent G2/1.0
X-Google-Web-Client true
MIME-Version 1.0
Subject Re: package extension problem
From Miki Tebeka <miki.tebeka@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Message-ID <mailman.5764.1329153506.27778.python-list@python.org> (permalink)
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

Show key headers only | View raw


> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

package extension problem Fabrizio Pollastri <f.pollastri@inrim.it> - 2012-02-12 19:46 +0100
  Re: package extension problem Miki Tebeka <miki.tebeka@gmail.com> - 2012-02-13 09:18 -0800
    Re: package extension problem Fabrizio Pollastri <f.pollastri@inrim.it> - 2012-02-13 18:53 +0100
      Re: package extension problem Miki Tebeka <miki.tebeka@gmail.com> - 2012-02-13 09:58 -0800
        Re: package extension problem Terry Reedy <tjreedy@udel.edu> - 2012-02-13 14:12 -0500
      Re: package extension problem Miki Tebeka <miki.tebeka@gmail.com> - 2012-02-13 09:58 -0800
    Re: package extension problem Peter Otten <__peter__@web.de> - 2012-02-13 19:28 +0100
  Re: package extension problem Miki Tebeka <miki.tebeka@gmail.com> - 2012-02-13 09:18 -0800

csiph-web