This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author asolano
Recipients asolano
Date 2013-04-08.23:26:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1365463591.17.0.891545615286.issue17670@psf.upfronthosting.co.za>
In-reply-to
Content
I stumbled upon this by chance. Is the following behaviour by design?

>>> s = 'a\tb'
>>> s.expandtabs(1) == s.expandtabs(2)
True

In fact:
>>> s.expandtabs(1)
'a b' # 1 space
>>> s.expandtabs(2)
'a b' # 1 space
>>> s.expandtabs(3)
'a  b' # 2 spaces
>>> s.expandtabs(4)
'a   b' # 3 spaces

It seems to be an off-by-one difference from 2 onwards. 

Tested with python versions 2.7.4, 3.2.4 and 3.3.1 on a Linux x86_64 machine.
History
Date User Action Args
2013-04-08 23:26:31asolanosetrecipients: + asolano
2013-04-08 23:26:31asolanosetmessageid: <1365463591.17.0.891545615286.issue17670@psf.upfronthosting.co.za>
2013-04-08 23:26:31asolanolinkissue17670 messages
2013-04-08 23:26:31asolanocreate