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


Groups > comp.lang.python > #37958

derived class name in python 2.6/2.7

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <fred.sells@adventistcare.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.034
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'subject:2.7': 0.09; 'def': 0.10; 'subject:python': 0.11; 'subject:class': 0.16; 'instance': 0.17; 'to:name:python-list@python.org': 0.20; 'bit': 0.21; 'pass': 0.25; 'subject:/': 0.28; 'skip:_ 10': 0.29; 'class': 0.29; 'basic': 0.30; 'print': 0.32; 'getting': 0.33; 'to:addr:python- list': 0.33; 'received:org': 0.36; 'but': 0.36; 'charset:us- ascii': 0.36; 'quite': 0.37; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'help': 0.40; 'received:216': 0.62
From "Sells, Fred" <fred.sells@adventistcare.org>
To "python-list@python.org" <python-list@python.org>
Subject derived class name in python 2.6/2.7
Thread-Topic derived class name in python 2.6/2.7
Thread-Index Ac3/JTPG0hMLxOquQJ2gtNrYoqB+Sw==
Date Wed, 30 Jan 2013 20:05:52 +0000
Accept-Language en-US
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
x-originating-ip [192.168.200.121]
Content-Type text/plain; charset="us-ascii"
Content-Transfer-Encoding quoted-printable
MIME-Version 1.0
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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>
Newsgroups comp.lang.python
Message-ID <mailman.1226.1359576407.2939.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1359576407 news.xs4all.nl 6958 [2001:888:2000:d::a6]:60756
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:37958

Show key headers only | View raw


This is simple, but I just cannot find it after quite a bit of searching

I have this basic design

class  A:
	def __init__(self):
		print 'I am an instance of ', self.__class__.name

class B(A):
	pass


X = B
I would like this to print "I am an instance of B"  but I keep getting A.  Can someone help me out here.

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


Thread

derived class name in python 2.6/2.7 "Sells, Fred" <fred.sells@adventistcare.org> - 2013-01-30 20:05 +0000

csiph-web