I have two definitions say,
file x.py:
class x:
def p(self, a, b) :
# ...
file y.py:
class y:
def p(self, a, b, c) :
# [...]
Now I am calling these functions from another file. Command line inputs having the file names (in this case x and y) are passed in cust variable.
file z.py:
from x import *
from y import *
class z:
cust.p(a, b, c)
x (or y) is being passed as the command line inputs to file z.py.
cust is the class variable of class z.
Now when cust = x object I get an error: takes exactly 2 arguments (3 given).
But when cust = y object it works fine.
How do i eliminate this error?
I do not want to modify the function definition in x.py and y.py files as there are many files.
How do i modify the code so that both the functions are called from the same function call without modifying the function definition?
Monkeypatch.