I have a class Query:
class Query
def __init__(self, keyword, **kwargs):
self.keyword = keyword
self.parameters = kwargs
def __repr__(self):
return "Query keyword %s, params %s" % (self.keyword, self.parameters)
Good so far. Now I created a class that inherits from it:
class SimpleQuery(Query):
def __init__(self, keyword, count, age):
Query(keyword, count, age)
And if I create an instance, I get...
>>> m = SimpleQuery(keyword, count=120, age=100)
TypeError: __init__() takes exactly 2 arguments (4 given)
What I would expect, of course, is for it to return an object along the lines of "Query keyword keyword, params {count: 120, age: 100}." What am I doing wrong?