31

Today in a Python question, the OP had an issue where some code was not accessible because of a spaces vs tabs issue.

Somehow, he had the first part of his code indented with tabs, and the second part of his code indented with spaces. And in Python, most of the time it's going to fail, but sometimes, it can lead to unexpected behaviour.

Hopefully people answering are smart enough to look at the question in edit mode and check whether those are spaces or tabs. But when you don't know that the renderer is expanding tabs to spaces, one could wrongly assume that the error is not tab related.

It'd be nice to have a visible cue in the code editor to show off what was originally tabs!

7
  • 11
    I agree, this feature is a must for all python users. Mar 18, 2016 at 21:53
  • 5
    Haskell has the same issue with tabs and spaces being different, and this feature would do wonders there as well.
    – sclv
    Mar 19, 2016 at 22:22
  • 2
    Well, we could also consider issues concerning yaml parsing.
    – zmo
    Mar 19, 2016 at 23:27
  • 2
    Well, maybe a warning already when posting would be nice... I mean, it would result in most posts where that would be an issue never being published at all. Mar 20, 2016 at 0:08
  • 2
    I believe the point of SO is that when people have an error or a weird issue, they google for it, and find a matching SO error… And every poster will get a different error for a similar issue. So getting rid of tabs issues (with your warning idea) will not really help people looking for a similar tab issue in the future.
    – zmo
    Mar 20, 2016 at 0:11
  • Another one
    – Elazar
    Nov 1, 2017 at 10:43
  • 2
    Also, this is not a feature request. This is a bug. People cannot ask meaningful questions about a programming problem they have, because the website transforms their programs. It's very much like replacing { with ( - unacceptable.
    – Elazar
    Nov 1, 2017 at 10:45

0

You must log in to answer this question.

Browse other questions tagged .