I have a set of functions fun1
, fun2
, fun3
that I'm calling from a main file. Each of them are using some variables stored in my main file (where I'm also calling the functions):
a = 2
b = 3
c = 12
d = "abc"
e 12
f = "jh4jer"
g = np.array(2,3)
fun1(a,b,c,d,e,f)
fun2(d,e,f,g)
fun3(a,e,f,g)
I would like to create a sort of structure (in my opinion a dictionary would be perfect) to store all my variables to I can pass only this dictionary to my functions, something like that:
dictionary1 = {'a':a, 'b':b, 'c':c, 'd':d, 'e':e, 'f':f, 'g':g}
fun1(dictionary1)
fun2(dictionary1)
fun3(dictionary1)
Can I do something like that or there is a smarter way? Is it going to be an issue if I pass more arguments to a function with respect to the ones required?