gin-config icon indicating copy to clipboard operation
gin-config copied to clipboard

Binding to same value from multiple files

Open alexd314 opened this issue 2 years ago • 1 comments

I wonder if it is/would be possible to bind multiple values to the same parameter via different config files. For instance:

File main.py

def myfunc(mylist):
    print(mylist)  

Gin-config file config1.gin:

myfunc.mylist += 'apples'

Gin-config file config2.gin:

myfunc.mylist += 'oranges'

Running the app

Then, when running the app, it should print:

['apples', 'oranges']

with the binding order based on the order of including 'config1.gin' and 'config2.gin'

alexd314 avatar Mar 12 '22 06:03 alexd314

Because I find this to be really valuable, I've made an implementation supporting dictionaries and lists here. I can make a PR if interested.

alexd314 avatar Apr 18 '22 12:04 alexd314