Understanding Inheritance in python
<p>I am learning OOP in python.</p>

<p>I am struggling why this is not working as I intended?</p>

<pre><code>class Patent(object):
    """An object to hold patent information in Specific format"""
    def __init__(self, CC, PN, KC=""):
        self.cc = CC
        self.pn = PN
        self.kc = KC

class USPatent(Patent):
    """"Class for holding information of uspto patents in Specific format"""
    def __init__(self, CC, PN, KC=""):
        Patent.__init__(self, CC, PN, KC="")


pt1 = Patent("US", "20160243185", "A1")

pt2 = USPatent("US", "20160243185", "A1")

pt1.kc
Out[168]: 'A1'

pt2.kc
Out[169]: ''
</code></pre>

<p>What obvious mistake I am making so that I am not able to get kc in USPatent instance?</p>

<pre><code>class USPatent(Patent):
    """"Class for holding information of uspto patents in Specific format"""
    def __init__(self, CC, PN, KC=""):
        Patent.__init__(self, CC, PN, KC="")
</code></pre>

<p>Here you pass <code>KC</code>as <code>""</code> by coding <code>KC=""</code>, instead of <code>KC=KC</code></p>

<p>To pass the inputted <code>KC</code>: </p>

<pre><code>class USPatent(Patent):
    """"Class for holding information of uspto patents in Specific format"""
    def __init__(self, CC, PN, KC=""):
        Patent.__init__(self, CC, PN, KC)
</code></pre>

python inheritance