在方法定义中,为什么有人将形式参数设置为amount
等于PERMANENCE_INC
形式参数列表中的常量?
def increasePermanence(self, amount=PERMANENCE_INC):
""" Increases the permanence of this synapse. """
self.permanence = min(1.0, self.permanence+amount)
在方法定义中,为什么有人将形式参数设置为amount
等于PERMANENCE_INC
形式参数列表中的常量?
def increasePermanence(self, amount=PERMANENCE_INC):
""" Increases the permanence of this synapse. """
self.permanence = min(1.0, self.permanence+amount)