3 ms·
The key is consistency I think. For matplotlib (which is probably one of the most commonly used modules that heavily uses args and kwargs), it's really useful.
by joshvm 10y ago
The key is consistency I think. For matplotlib (which is probably one of the most commonly used modules that heavily uses args and kwargs), it's really useful. On the other hand it's only useful because their web documentation is really good and most of the time the args/kwargs are consistent between functions.
It also helps that most matplotlib kwargs can be controlled using an additional function, if you have a reference to the line/plot you want to modify. So you could do:
plt.plot(range(10), ls='solid')
or equally:
lines = plt.plot(range(10))
lines[0].set_linestyle('solid')
But in the end it comes down to documentation. I think Python traces are generally pretty good at telling you what you did wrong.