4 ms·
why not use their ```# fmt: off``` ? I have not used Black, but considering it so I am curious about these occasional situations where you want to override aut
by zild3d 7y ago
why not use their ```# fmt: off``` ?
I have not used Black, but considering it so I am curious about these occasional situations where you want to override auto-formatting
- arnioxux 7y agoI write a lot of scientific code with python and in those cases you really want your equations and matrix columns aligned for readability. These matrices appear so often adding fmt:off destroys the readability/elegance gain from the clever formatting. Here's an example snippet by Peter Norvig that is beautifully formatted: def neighbors4(point): "The four neighboring squares." x, y = point return ( (x, y-1), (x-1, y), (x+1, y), (x, y+1)) def neighbors8(point): "The eight neighboring squares." x, y = point return ((x-1, y-1), (x, y-1), (x+1, y-1), (x-1, y), (x+1, y), (x-1, y+1), (x, y+1), (x+1, y+1))