4 ms·
Especially when they don't even leave a doc string so you're forced to track down the packages documentation online just to interact with certain interfaces. I
by Syntaf 3y ago
Especially when they don't even leave a doc string so you're forced to track down the packages documentation online just to interact with certain interfaces.
I work in a large python codebase, we have almost no usage of `*kwargs` beyond proxy methods because of the nature of how they obfuscate the real interface for other developers.
- hqudsi 3y agoWhen I was first starting out, a then senior engineer told me: "friends don't let other friends use kwargs". That always stuck with me.
- icedchai 3y agoI once worked on a code base where we had *kwargs passed down 4 or 5 layers deep (not my idea.) It was a true joy.
- akasakahakada 3y agoThis is literally me. It is a math program that can evaluate equations and generate code. 6 layers of heterogeneous data structure which the math operation being act on 1st layer has its effect down to 6th layer. Temporarily using *kwargs to make it works but still thinking what is the proper way to do it right.
- crazydoggers 3y agoCan you organize the data structures into classes or dataclasses?
- akasakahakada 3y agoAlready doing this. The problem is there are 5 layers in between. Copy and paste the same docstring into all layers is doable but do not seem smart.
- c32c33429009ed6 3y agoOut of interest, what sort of company/industry do you work in where you're able to work on this kind of thing?
- nerdponx 3y agoThe worst is when someone puts **kwargs at the base of a class hierarchy, not only necessitating its use in subclasses (if you want to be strict about types) but also swallowing errors for no good reason. Fortunately I think this style is fading out as type hints become more popular.