Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How is it more "readable"? The two are just as readable.

What do you do with your first example if you have a list (generated at runtime, not a static one) to pass to the function? This wouldn't work (imagine the first line is more complicated):

    l = (1,2,3)
    print(l)


that's what the splat operator is for - it unpacks a list into separate arguments. in this case e.g.

   xs = (1, 2, 3)
   f(*xs)
is equivalent to f(1, 2, 3), not f((1, 2, 3))


And that's readable?


It's more readable, for my brain at least, because there is less distracting syntax cruft lying around.


You're distracted by the parentheses? Really?


Absolutely!

Something I keep relearning is that people are different, sometimes in ways hard for me to comprehend :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: