Re:Tabs or spaces – Parsing a 1B files among 14 programming ...
by deniska on Wednesday August 31, 2016 @09:53AM
(#12398273)
Python treats a tab character as the amount of spaces needed to go into the nearest multiple of 8 column. With py2 ability to mix different indentation as far as it amounts to the same column, you can format your code in pretty interesting ways.
Re:Tabs or spaces – Parsing a 1B files among 14 programming ...
by yxhuvud on Wednesday August 31, 2016 @09:56AM
(#12398297)
Well, python most certainly do care in the case when tabs and spaces are used inconsistently. In python2 you could even redefine tab width inline like https://gist.github.com/yxhuvud/2006599 .
IOW, Python is actually far more pragmatic than most people (including most Python programmers) think. It just has a culture that strongly advocates following the rules (i.e. PEP-8 and PEP-20).