[issue17670] expandtabs() weirdness

2013-04-10 Thread Roger Serwy

Roger Serwy added the comment:

LGTM.

--
nosy: +roger.serwy
stage: patch review -> commit review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17670] expandtabs() weirdness

2013-04-09 Thread Ned Deily

Ned Deily added the comment:

That's a good point.  Here's a patch for the documentation with a simplified 
example:

  >>> '01\t456\t89'.expandtabs(4)
  '01  456 89'

What do others think: is an example useful and, if so, this example?

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
keywords: +patch
nosy: +docs@python
resolution: works for me -> 
stage: committed/rejected -> patch review
status: closed -> open
type: behavior -> 
versions: +Python 3.4
Added file: http://bugs.python.org/file29759/issue17670_doc.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17670] expandtabs() weirdness

2013-04-09 Thread Alfredo Solano Martínez

Alfredo Solano Martínez added the comment:

It does, thank you. Maybe hat example could be added to the docuentation?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17670] expandtabs() weirdness

2013-04-08 Thread Ned Deily

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com