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

Are you referring to this line where he initializes 4 variables?

bounds, s, t, j = (0,0), -float('infinity'), 0, 0



Yes, and the `bounds, s = (j, i+1), t` especially when forced onto the same line as the if statement.

See the Python Style Guide: http://www.python.org/dev/peps/pep-0008/ "Compound statements (multiple statements on the same line) are generally discouraged."


I agree about compound statements, but I think most people will use the tuple assignment style, especially when its simply initializing variables. There is no reason to expand it beyond one line.


There is a reason: it reduces the reading distance from variable to initial value. It also reduces the amount of effort you need to exert to map them to each other. This is especially true when you are using () which impact the meaning of ','.

There's also no reason to keep it on one line :-)

Newlines and equal signs are cheap; go wild!




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

Search: