import datetime
class Logger(object):
def log(self, message):
print message
class TimestampLogger(Logger):
def log(self, message):
message = "{ts} {msg}".format(ts=datetime.datetime.now().isoformat(),
msg=message)
super(TimestampLogger, self).log(message)
class Parent(object):
def __init__(self, a, b):
print 'a', a
print 'b', b
class Child(Parent):
def __init__(self, c, d, *args, **kwargs):
print 'c', c
print 'd', d
super(Child, self).__init__(*args, **kwargs)
test = Child(1,2,3,4)
class Bar(object):
def __init__(self, arg1=None, arg2=None, argN=None):
print arg1, arg2, argN
class Foo(Bar):
def __init__(self, my_new_arg=None, **kwds):
super(Foo, self).__init__(**kwds)
self.new_arg = my_new_arg
print my_new_arg
f = Foo(my_new_arg='x', arg2='y')