News for hackers. Stuff that matters.
Re:Guido was right, there should be no lambda in Python (2018) by thaumasiotes on Tuesday September 27, 2022 @08:48PM (#33003050)
Technically, it has the benefit that code cannot be incorrectly indented - it can't be formatted to look like the scope is one way when in reality it's another way.
Re:Guido was right, there should be no lambda in Python (2018) by kimmeld on Tuesday September 27, 2022 @08:57PM (#33003102)
Code can absolutely be incorrectly indented in python and to make matters worse it changes the functionality of the code when it is.
Re:Guido was right, there should be no lambda in Python (2018) by thaumasiotes on Wednesday September 28, 2022 @02:43AM (#33004911)
Code can be indented in a way you didn't mean for it to be. But it cannot be incorrectly indented in the sense I just described, because the indentation changes the functionality of the code. The indentation can never mislead you about the structure of the code.
Re:Guido was right, there should be no lambda in Python (2018) by Izkata on Wednesday September 28, 2022 @07:49AM (#33006844)
I've seen one case where it has, where the outdent at the end of a nested loop/loop/if was wrong: it was only 3 spaces instead of matching the 4 indent, so it looked right at a glance but wasn't. Needed to use pdb to step through it and see it do the wrong thing before that stuck out.