Derived Class Not Running Code In _init_
Why would the following code not print 'Hello'? # C derives from B, which derives from A, which derives from object class D(C): def _init_(self, *args, **kw): print 'Hello'
Solution 1:
You need to use double underscores:
def__init__(self, *args, **kw):
The method _init_
has no special meaning to Python and won't be called when instantiating.
Post a Comment for "Derived Class Not Running Code In _init_"