Disable inheriting from a class
Hello, How do I set a custom class (product) so that it is locked against inheriting? I mean, if I'm creating another custom product (ZClass), ZOPE allows me to import so-called Base Classes. I need to get my class off of the list, for some compatibilty and conflict issues. I did search for answer to this in documentation an on the web, but I didn't find any useful hints. Thanks in advance for your tips, -Mac =============================== Jan 'Mac' Maska, web developer Systinet, Prague(CZ) jan.maska@systinet.com tel.:(+420)608453492 visit http://www.systinet.com ===============================
Jan Ma-Bška wrote at 2003-4-3 14:16 +0200:-A
How do I set a custom class (product) so that it is locked against inheriting? I mean, if I'm creating another custom product (ZClass), ZOPE allows me to import so-called Base Classes. I need to get my class off of the list, for some compatibilty and conflict issues.
I fear, Zope does not support this (without code modification). Dieter
On Thu, Apr 03, 2003 at 02:16:41PM +0200, Jan Ma?ka wrote:
Hello,
How do I set a custom class (product) so that it is locked against inheriting?
On python level you can assert that self is your object: class Foo: def __init__(self): assert(self.__class__==Foo)
I need to get my class off of the list, for some compatibilty and conflict issues.
Have a look at the source of zope. Maybe you find a solution there. Last change is to patch the source. thomas -- Thomas Guettler <guettli@thomas-guettler.de> http://www.thomas-guettler.de
participants (3)
-
Dieter Maurer -
Jan Maška -
Thomas Guettler