本文共 171 字,大约阅读时间需要 1 分钟。
静态方法参数没有实例参数 self, 也就不能调用实例参数
class a(object): @staticmethod def b(numble): a.numble = numble print(a.numble)if __name__ == '__main__': a.b(3)
输出:
转载地址:http://uqhyk.baihongyu.com/