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