4 ms·
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.
by IgorPartola 1y ago
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.
- IshKebab 1y agoYou 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-arguments-for-goodness-sake-4de2faf78986 https://medium.com/codex/stop-using-kwargs-as-method-argumen... http://ivory.idyll.org/blog/on-kwargs.html http://ivory.idyll.org/blog/on-kwargs.html Give me another one.
- almostgotcaught 1y agolol 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).
- IshKebab 1y agoSo when they said "kwargs" they didn't actually mean **kwargs they meant something else which doesn't even require kwargs? How did you magically infer that?
- ahupp 1y agoI’d agree with this, unless the kwargs is typed with the new-ish PEP-692: https://peps.python.org/pep-0692/ https://peps.python.org/pep-0692/