Black_Ram
Black_Ram

Reputation: 443

SyntaxError: non-keyword arg after keyword arg in arguments function

I have this functions:

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

The error in title is in this function:

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

Why? Thanks for the solution.

Upvotes: 1

Views: 7655

Answers (3)

Black_Ram
Black_Ram

Reputation: 443

Problem solved with other method:

variable1 = None
variable2 = None

class.function(variable1, variable2, client_id, client_secret)

Upvotes: 1

Ankur Agarwal
Ankur Agarwal

Reputation: 24778

Check out section 4.7.2 here:

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

Upvotes: 0

BrenBarn
BrenBarn

Reputation: 251578

It's just what it says. You can't pass non-keyword arguments after keyword arguments. If you have something like client=None, that's a keyword argument, and all of those have to come at the end of the argument list.

Upvotes: 7

Related Questions