【发布时间】:2012-07-12 13:24:03
【问题描述】:
所以我有一个这样定义的函数:
def getDistnace(self, strings, parentD, nodeName, nodeDistance):
我是这样称呼它的:
Node.getDistnace(newNode, strings, parentD, nodeName=None, nodeDistance=None)
和
Node.getDistnace(node, strings=None, parentD=None, nodeName, nodeDistance)
它们都来自其他两个不同的功能。但我的问题是我收到一条错误消息,指出存在non-keyword arg after keyword arg。
有没有办法解决这个错误?第一个Node.getDistnace 将strings 和parentD 添加到getDistance,第二个Node.getDistnace 将nodeName 和nodeDistance 添加到函数中。
【问题讨论】:
标签: python function arguments keyword