Skip to content
Advertisement

Python Decorator, Wrapper got argument multiple times

I wrote this decorator to be used by two functions:

JavaScript

I keep getting the error:

JavaScript

How can I pass the argument page recursively without having it multiple times?

Thanks!

EDIT:

functions are called as in:

JavaScript

Advertisement

Answer

Positional arguments in python must be passed in order of definition in the function prototype.
This line passes the value of survey_id to the argument page as it’s the second argument passed.

JavaScript

Call the function as:

JavaScript
Advertisement