Python class variable update
<pre><code>class MyClass(object):
    next_number = 0

    def __init__(self):
        self.number = self.next_number
        MyClass.next_number += 1

class MyClassA(MyClass):
    pass
</code></pre>

<p>Above it would appear I am forced hardcode the class name when updating the class variable on line 6 since writing:</p>

<pre><code>self.__class__.next_number += 1
</code></pre>

<p>results in a new class variable in any derived class. Is there any alternative to hardcoding the class name?</p>

<p>Also on line 5 should I instead write:</p>

<pre><code>self.number = self.__class__.next_number
</code></pre>

<p>to make it obvious next_number is a class variable.</p>