I\'m confused by how the length of a string is calculated when expandtabs is used. I thought expandtabs replaces tabs with the appropriate number of spaces (with the default
The tab increments the column pointer to the next multiple of 8:
>>> 'abc\tabc'.expandtabs().replace(' ', '*') 'abc*****abc'