← Back to context

Comment by IshKebab

1 day ago

You shouldn't be using dicts for data that you know the name of anyway - use dataclasses or named tuples. Dicts are best for things with keys that are not known at compile time.

Since when can you use data classes for kwargs? There are plenty of times when you should use a dict even if you know the keys.

Sure, but destructuring makes sense for both. Just assign the variables without corresponding keys a value of None.