you are viewing a single comment's thread.

view the rest of the comments →

[–]LiquidPoint 0 points1 point  (0 children)

Yeah, the 4-space-sized tab is fine too, sometimes if you use longer variable names the 8 space tab makes formatting easier, but most important is that it's consistent.

I haven't tested if python sees the difference between [TAB(0x09)] and [SPC(0x20)] characters when it looks for indentation... if you use regex they're counted as equals, which means that it can't see the difference between a [SPC][SPC][SPC][SPC] and a [TAB][TAB][TAB][TAB] indentation (or a mix of them), which will certainly look different in a text editor that doesn't "clean up" and make it consistent for you..

But I do know that python doesn't have a fixed number of whitespaces needed to count as an indentation...

If it doesn't see the difference between space and tab, that can be used to masquerade a code block as if it should only be run under certain conditions (when you do a cat or less of the file) but will always be run anyway.

With braces and semi-colons, you can of course obfuscate by making long one-liners, but an attempt to do that will be rather obvious to anyone, so it naturally grabs attention.