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

It's clearer because with the duplicated variable name, the syntax is just a special case of the general default argument syntax. The default value for the "visibility" parameter is the value of the "visibility" variable in the scope the function belongs to. Anyone who knows the default argument syntax can work that out. And even if you don't know the default argument syntax, you might be able to guess how it works by analogizing it to the similar-looking variable assignment syntax. With the new syntax, on the other hand, you have to know about it in order to understand what it does. It just adds one more thing people will have to learn about Python syntax, for, as far as I can see, a very minor benefit. The trade-off doesn't seem worth it to me, given that one of Python's USPs is its relative accessibility to newcomers.


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

Search: