我正在查看以下 python3 代码:
class MyClass(MyAbstractClass):
:
def my_fun1(self, input1):
:
return result
然后在代码的其他部分,MyClass 的用法如下:
output = MyClass().my_fun1(input1)
我想知道是否MyClass().my_fun1(input1)
隐式实例化 MyClass 的对象?或者这里的 MyClass() 被视为实用函数类?如果它是一个实用函数,为什么还要把它放在一个类中呢?或者它是一个静态类?但它my_fun1
没有标记为静态函数?
对不起,我来自 C++/Java 背景,所以这对我来说有点奇怪......
非常感谢!