Ned Deily added the comment: Yes, the behavior is by design. I think you are misunderstanding how exandtabs() works. The "tabsize" argument indicates the number of columns each tab position occupies. So, with a tabsize of 4, the tab positions occur every four columns; the tab positions are where the characters immediately following the tab character start. Perhaps this example will make the behavior clearer:
>>> '1\t2'.expandtabs(4) '1 2' >>> '12\t3'.expandtabs(4) '12 3' >>> '123\t4'.expandtabs(4) '123 4' ---------- nosy: +ned.deily resolution: -> works for me stage: -> committed/rejected status: open -> closed title: expandabs() weirdness -> expandtabs() weirdness _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17670> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com