1

我有这个功能:

def crypting(self, client, access_token, client_id, client_secret, oauth_scope, redirect_uri):

标题中的错误在此函数中:

FCU.crypting(client = None, access_token = None, client_id, client_secret, oauth_scope, redirect_uri)

为什么?感谢您的解决方案。

4

3 回答 3

7

这就是它所说的。您不能在关键字参数之后传递非关键字参数。如果你有类似的东西client=None,那是一个关键字参数,所有这些都必须放在参数列表的末尾

于 2013-08-25T15:37:55.557 回答
1

用其他方法解决的问题:

variable1 = None
variable2 = None

class.function(variable1, variable2, client_id, client_secret)
于 2013-08-30T16:35:33.577 回答
0

在此处查看第 4.7.2 节:

http://docs.python.org/2/tutorial/controlflow.html

于 2013-08-25T18:13:30.067 回答