News for hackers. Stuff that matters.
Re:Comprehensive Python Cheatsheet (2018) by Singletoned on Monday February 04, 2019 @11:51AM (#19077854)
But he could achieve exactly the same thing by using descriptive variable names without the angle brackets. Admittedly he can't use `list` as it's a built-in but `a_list` or `list_` would be much better than `<list>`.
Re:Comprehensive Python Cheatsheet (2018) by pizzaburek on Monday February 04, 2019 @12:08PM (#19078102)
My personal opinion is that `list_` is among the worst possible variable names (together with `bar` and `foo`). It's non-descriptive, ugly, hard to recognize, looks scary to beginners and maybe worst of all it's easy to forget the underscore when typing.
Re:Comprehensive Python Cheatsheet (2018) by Singletoned on Tuesday February 05, 2019 @05:05AM (#19084053)
That's exactly what he's used, but with angle brackets around it. What do you think he should have done instead.
Re:Comprehensive Python Cheatsheet (2018) by wenc on Monday February 04, 2019 @01:40PM (#19079238)
Good point. For list, one could still use the name "lst" and get the point across.