John wrote:

> Following up on this...
> 
> Why does pylint seem to think it is a bad idea?
> 
> Description   Resource        Path    Location        Type
> ID:W0142 plot_ts_array_split_x: Used * or **
> magic tsplot.py       /research.plot  line 299        PyLint Problem

I would guess it's a readability concern. Consider a simple function

def f(x, y=0):
    print x + y

for a in [1], "ab", "abc":
    f(*a)

Can you tell what will be printed immediately? For me

f(1)
f("a", "b")
f("a", "b", "c")

is much easier to predict.

That said, there are valid usecases for * and ** "magic", and of course 
pylint cannot take the tradeoffs into account. Therefore don't take pylint's 
warnings as gospel.

PS: the exception is intentional

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to