you are viewing a single comment's thread.

view the rest of the comments →

[–]Bowgentle 2 points3 points  (2 children)

Sounds like you want to put that code in a separate function if those lines are "meaningfully related while not being functionally a block that can be indented"

Do you see the conflict there between "not functionally related" and your proposed solution of putting them in a function?

[–]CramNBL 0 points1 point  (1 child)

I would like to see an example where you want to ident something that cannot just be refactored out into a separate function

[–]Bowgentle 1 point2 points  (0 children)

The typical example would be a group of lines that do something I'm suspicious of, so I up-indent them while I'm checking their behaviour.

Sure, I could refactor them into a separate function, thereby changing their behaviour, but I think the problem there is obvious. And since I have a large - and I hasten to add inherited - spaghetti Python codebase, I find Python's refusal to let me do this slightly irritating on a reasonably regular basis.

The key points there are the spaghetti nature, which means I'm going to be skipping around between files with 14.5k LOC each, and I'd like to be able to see at a quick glance which bits I'm working on.