On Mon, Oct 21, 2019 at 8:21 PM Yonatan Zunger <zunger@humu.com> wrote:
Hey everyone,
I came across a case which might be a use case for a syntax extension, but I'm not sure. Wanted to get feedback from the group.
[...]
@CronJob('job-name', params...).override('dev', more-params...) def myFunction(...)
Could you modify the signature of CronJob's __init__ method to accept override parameters as a dict or list in a keyword argument? Then this example would look something like this: @CronJob('job-name', params..., dev=more-params...) def myFunction(...) Internally, you could even keep the .override() method and have __init__ call that method to do the work. The signature of __init__ could then either include an explicit keyword argument (defaulting to None) for each environment you need to account for, or if there are too many, a **kwargs catch-all from which you extract what you need.