5 ms·
It's not really discussed in the PEP but in fact python treats the tab at the same indentation level as 8 spaces. You can mix tabs and 8 spaces without impunit
by veyron 15y ago
It's not really discussed in the PEP but in fact python treats the tab at the same indentation level as 8 spaces. You can mix tabs and 8 spaces without impunity
Check http://ideone.com/VIwf4 http://ideone.com/VIwf4 for an example. Basically, it shows that python treats 8 spaces at the same indent level as a tab
- max99x 15y agoI think ideone and/or your editor converts tabs to 8 spaces. Trying a tab indent followed by an 8-space one raises an error in native IPython for me. In any case, we're using normal CPython compiled to JavaScript, so it's unlikely to change finer points of the behaviour like this.
- veyron 15y agoin CPython (at least, on my mac) mixing tabs and 8 spaces works perfectly fine. try it out!