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.
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.
You shouldn't be using kwargs! That is also well known to be bad practice (or it should be anyway).
https://medium.com/codex/stop-using-kwargs-as-method-argumen...
http://ivory.idyll.org/blog/on-kwargs.html
Give me another one.
I’d agree with this, unless the kwargs is typed with the new-ish PEP-692: https://peps.python.org/pep-0692/
lol i think you didn't read/understand this - the article is about **kwargs (which is sometimes sloppy) while the person you're responding to is talking about "exploding" a dict when calling a function (this does not require **kwargs at all).
Sure, but destructuring makes sense for both. Just assign the variables without corresponding keys a value of None.