I'm learning the Python programming language and I've came across something I don't fully understand. 我正在學習Python編程語言,遇到了一些我不太瞭解的東西。 編程
In a method like: 用相似的方法: 編程語言
def method(self, blah): def __init__(?): .... ....
What does self
do? self
作什麼的? What is it meant to be? 這是什麼意思? Is it mandatory? 它是強制性的嗎? 學習
What does the __init__
method do? __init__
方法有什麼做用? Why is it necessary? 爲何有必要? (etc.) (等等。) spa
I think they might be OOP constructs, but I don't know very much. 我認爲它們多是OOP構造,但我不太瞭解。 .net