3 ms·
Your signature requires exactly 3 positional[0] and 3 keyword arguments. The OP allows any number of either. [0] actually 3 positional-or-keyword which is even
by masklinn 3y ago
Your signature requires exactly 3 positional[0] and 3 keyword arguments. The OP allows any number of either.
[0] actually 3 positional-or-keyword which is even more widely divergent
- vorticalbox 3y agoBut why would you want that doesn't that make for a more confusing api? Would it not be better to just have everything as a kwarg? You would get better types that way
- masklinn 3y agoI genuinely don’t understand what you are asking.
- zbentley 3y agoI think what GP is saying is that with explicit kwargs you can't express variadic signatures, i.e. "this function takes one int positional, and then any number of key/value pairs where the values are lists". The variable length is the important bit. It's certainly debatable whether doing that is better than passing a single argument whose value is a dict with that same type, but many people do prefer the variadic args/kwargs style.