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.
Created on 2011年10月11日 13:05 by john.feuerstein, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| textwrap_tabsize.diff | john.feuerstein, 2011年10月11日 13:04 | review | ||
| textwrap_tabsize_v2.diff | john.feuerstein, 2011年11月07日 13:58 | review | ||
| Messages (8) | |||
|---|---|---|---|
| msg145341 - (view) | Author: John Feuerstein (john.feuerstein) * | Date: 2011年10月11日 13:04 | |
The textwrap module calls .expandtabs() to expand tabs to spaces. This patch adds support for a custom tabsize, so that .expandtabs(tabsize) is called instead. Includes test case. |
|||
| msg145572 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2011年10月14日 23:40 | |
I am a bit surprised this was not part of the original design. 'Tabsize' make 'expand_tabs' redundant and tabsize==0 could be interpreted as expand_tabs==False. On the other hand, the meaning of 'expand_tabs' could be expanded to include the tabsize. I am almost tempted to suggest making expand_tabs > 1 be interpreted as tabsize and make expand_tabs==True(1, the current default) be interpreted as expand_tabs==8 (the new default) for back_compatibility. Patch as is has new tests and looks good on first reading. |
|||
| msg145878 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2011年10月18日 23:53 | |
+1 |
|||
| msg146764 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2011年11月01日 09:53 | |
Two comments: * The new parameter to __init__ should be added at the end of the parameter list. * A documentation update would be nice. |
|||
| msg147221 - (view) | Author: John Feuerstein (john.feuerstein) * | Date: 2011年11月07日 13:58 | |
textwrap_tabsize_v2.diff: * Moved the tabsize parameter to the end of the parameter list * Added documentation update * Made the test case more obvious |
|||
| msg159689 - (view) | Author: Hynek Schlawack (hynek) * (Python committer) | Date: 2012年04月30日 11:22 | |
The code LGTM, the documentation lacks `versionchanged` tag though. Would you mind adding it? |
|||
| msg161110 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年05月19日 11:49 | |
New changeset d38e821c1b80 by Hynek Schlawack in branch 'default': #13152: Allow to specify a custom tabsize for expanding tabs in textwrap http://hg.python.org/cpython/rev/d38e821c1b80 |
|||
| msg161111 - (view) | Author: Hynek Schlawack (hynek) * (Python committer) | Date: 2012年05月19日 11:50 | |
I've added it myself and committed your code – thank you for your contribution John! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:22 | admin | set | github: 57361 |
| 2012年05月19日 11:50:52 | hynek | set | status: open -> closed resolution: fixed messages: + msg161111 stage: patch review -> resolved |
| 2012年05月19日 11:49:06 | python-dev | set | nosy:
+ python-dev messages: + msg161110 |
| 2012年04月30日 11:22:08 | hynek | set | nosy:
+ hynek messages: + msg159689 |
| 2011年11月07日 13:58:37 | john.feuerstein | set | files:
+ textwrap_tabsize_v2.diff messages: + msg147221 |
| 2011年11月01日 09:53:58 | georg.brandl | set | messages: + msg146764 |
| 2011年10月18日 23:53:58 | rhettinger | set | nosy:
+ rhettinger messages: + msg145878 |
| 2011年10月14日 23:40:11 | terry.reedy | set | nosy:
+ terry.reedy messages: + msg145572 |
| 2011年10月11日 13:13:54 | ezio.melotti | set | keywords:
+ needs review nosy: + georg.brandl stage: patch review |
| 2011年10月11日 13:05:00 | john.feuerstein | create | |