expandtabs acts unexpectedly

digisatori at gmail.com digisatori at gmail.com
Wed Aug 19 03:57:44 EDT 2009


Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> ' test\ttest'.expandtabs(4)
' test   test'
>>> 'test \ttest'.expandtabs(4)
'test    test'

1st example: expect returning 4 spaces between 'test', 3 spaces
returned
2nd example: expect returning 5 spaces between 'test', 4 spaces
returned

Is it a bug or something, please advice.



More information about the Python-list mailing list