Fix Python – Inheritance and init method in Python

I’m begginer of python. I can’t understand inheritance and __init__().
class Num:
def __init__(self,num):
self.n1 = num

class Num2(Num):
def show(self):
print self.n1

mynumber = Num2(8)
mynumber.show()

RESULT: 8
This is OK. But I replace Num2 with
class Num2(Num):
def __init__(self,num):
self.n2 = num*2
d….

Fix Python – Python extending with – using super() Python 3 vs Python 2

Originally I wanted to ask this question, but then I found it was already thought of before…
Googling around I found this example of extending configparser. The following works with Python 3:
$ python3
Python 3.2.3rc2 (default, Mar 21 2012, 06:59:51)
[GCC 4.6.3] on linux2
>>> from configparser import SafeConfigParser
>>> class AmritaConfigPars….

Fix Python – Why aren’t superclass __init__ methods automatically invoked?

Why did the Python designers decide that subclasses’ __init__() methods don’t automatically call the __init__() methods of their superclasses, as in some other languages? Is the Pythonic and recommended idiom really like the following?
class Superclass(object):
def __init__(self):
print ‘Do something’

class Subclass(Superclass):
d….

Fix Python – super() fails with error: TypeError “argument 1 must be type, not classobj” when parent does not inherit from object

I get some error that I can’t figure out. Any clue what is wrong with my sample code?
class B:
def meth(self, arg):
print arg

class C(B):
def meth(self, arg):
super(C, self).meth(arg)

print C().meth(1)

I got the sample test code from help of ‘super’ built-in method.
Here is the error:
Traceback (most recent call last):
….

Fix Python – How to “perfectly” override a dict?

How can I make as “perfect” a subclass of dict as possible? The end goal is to have a simple dict in which the keys are lowercase.
It would seem that there should be some tiny set of primitives I can override to make this work, but according to all my research and attempts it seem like this isn’t the case:

If I override __getitem__/__setitem__, t….