[TriZPUG] pylint magic

Chris Calloway cbc at unc.edu
Wed Aug 25 21:33:04 CEST 2010


I have some code, a function invocation, which looks like:

expand(*_config)

pylint flags that statement with the message:

"Used * or ** magic"

Is using tuple or dict expansion in a function argument really 
considered "magic" in a community sense?

Is this a PEP violation which got by me? Or just a pylint bias?

To me, the statement is just Pythonic elegance. If I already have a 
tuple appropriately ordered to match a function's parameter signature, 
why would I want to go through tuple unpacking into a bunch of new 
identifiers just to satisfy some overreaching meta-explicitness. This 
seems to me like a hobgoblin of little minds rather than enhanced 
readability.

What am I blind to here? The function being called is in the same module 
and has an explicit parameter signature. With doctests. And passes pep8 
and pyflakes.

Please discuss amongst yourselves for my edification.

-- 
Sincerely,

Chris Calloway
office: 332 Chapman Hall   phone: (919) 599-3530
mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599


More information about the TriZPUG mailing list