-
-
Notifications
You must be signed in to change notification settings - Fork 815
Description
🚀 Feature Request
Hi Omry!
In a yaml file under the _target_ I'd like the ability to pass things to functions and constructors which accept var args or positional only arguments.
Motivation
Is your feature request related to a problem? Please describe.
Functions like np.random.randn are currently uncallable. Some Objects are unconstructable.
Pitch
Describe the solution you'd like
I'd like to be able to write something like this in a yaml file
positional_only_ob:
_target_: PositionalOnlyArgs
args:
foo: 15 #positional only arg
bar: 20 # regular argfor var args the syntax might be something like this:
var_args_ob:
_target_: VarArgs
args: #var args
- 1
- 2
- 3
bar: 20 # regular argDescribe alternatives you've considered
- We could make it so we use
_args_instead ofargs. - We could use a different keyword of
kwargs, and pass by position by default. - You could always use the proposed positional only args syntax since names will be ignored anyways
- You could always use the proposed var args syntax (I think)
Are you willing to open a pull request? (See CONTRIBUTING)
Yes
Additional context
I've tried on master (1.1.dev5)
As a side note, this feature is necessary to support instantiation of tuples and sets, but that is a separate feature request I'll likely make once if this becomes supported.