![](/img/trans.png)
[英]SyntaxError: non-keyword arg after keyword arg, with no apparent reason
[英]SyntaxError: non-keyword arg after keyword arg in arguments function
我有這個功能:
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)
為什么? 感謝您的解決方案。
這就是它所說的。 您不能在關鍵字參數之后傳遞非關鍵字參數。 如果您有諸如client=None
,則這是一個關鍵字參數,所有這些參數都必須位於參數列表的末尾 。
用其他方法解決的問題:
variable1 = None
variable2 = None
class.function(variable1, variable2, client_id, client_secret)
在這里查看第4.7.2節:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.