Brian van den Broek wrote:
The code below exhibits an attempt to refer to the type of a __Class
from within a method of that class. I've been unable to figure out how
to make it work as I want, and would appreciate any insight.
The problem emerged out of a bad design that the good folks on
Hi all,
The code below exhibits an attempt to refer to the type of a __Class
from within a method of that class. I've been unable to figure out how
to make it work as I want, and would appreciate any insight.
The problem emerged out of a bad design that the good folks on the
tutor list helped
Brian van den Broek wrote:
But the academic issue How/Can it be done? still itches.
class __TwoUnderBase(object):
def __init__(self):
if self.__class__.__name__ == __TwoUnderBase:
print From __TwoUnderBase
else:
print From subclass,
/F
Fredrik Lundh said unto the world upon 2005-10-09 17:49:
Brian van den Broek wrote:
But the academic issue How/Can it be done? still itches.
class __TwoUnderBase(object):
def __init__(self):
if self.__class__.__name__ == __TwoUnderBase:
print From