Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Mixin(object):
- def __init__(self, *args, **kwargs):
- super(Mixin, self).__init__(*args, **kwargs)
- print 'yelp!'
- class Foo(Mixin):
- def __init__(self, *args, **kwargs):
- self.bla = kwargs.pop('bla')
- super(Foo, self).__init__(*args, **kwargs)
- f = Foo(bla=42)
- yelp!
- f = Foo(bla=42, bar=23)
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- File "<stdin>", line 4, in __init__
- File "<stdin>", line 3, in __init__
- TypeError: object.__init__() takes no parameters
Advertisement
Add Comment
Please, Sign In to add comment