Python: Why call "__init__" instead of className ()?

Since the call className()will execute the code in __init__(args), why is there someone explicitly calling in the code below __init__?

class Example(Frame):

    def __init__(self, parent):
        Frame.__init__(self, parent)   

Is there a difference in the actual code that runs between the two method calls, or is chossing __init__()over className()just arbitrary?

Running Python 3.4

+4
source share
1 answer

className() , __init__. __new__, . Frame() self ; .

__init__, __init__ , . , , , , .

+8

Source: https://habr.com/ru/post/1546185/


All Articles