[Zope] ExtenssionClasses Question: (was: Python Question: Morphing Classes?

Johan Carlsson [EasyPublisher] johanc@easypublisher.com
Tue, 10 Dec 2002 00:51:42 +0100


At 23:57 2002-12-09 +0100, Johan Carlsson [EasyPublisher] wrote:
>Creating an instance (a) of the class C: pass, I can set the
>a.__class__=3DA (where A is another class), a will report that it
>is a instance of A and it will have all of A's class context.
>
>This look like a possible, even if not so less hackerish, way around my=20
>problem.
>
>Are there any traps I could fall into here?

I just found an even better (or at least more working way) to do this:

obj =3D new.instance(Class, Dict)

The problem is that new.instance doesn't seam to work with Extension=
 Classes?

Any idea?

Johan Carlsson



--=20
Torped Strategi och Kommunikation AB
Johan Carlsson
johanc@easypublisher.com

Mail:
Birkagatan 9
SE-113 36  Stockholm
Sweden

Visit:
V=E4stmannagatan 67, Stockholm, Sweden

Phone +46-(0)8-32 31 23
Fax +46-(0)8-32 31 83
Mobil +46-(0)70-558 25 24
http://www.easypublisher.com
http://www.torped.se