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.

classification
Title: Add full list of possible args to textwrap: wrap, fill, shorten
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: andrei.avk, asvetlov, docs@python, jack__d, lukasz.langa, miss-islington
Priority: normal Keywords: patch

Created on 2021-07-01 16:24 by andrei.avk, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 26999 merged jack__d, 2021-07-02 17:57
PR 27424 merged miss-islington, 2021-07-28 15:15
PR 27425 merged miss-islington, 2021-07-28 15:15
PR 27671 merged andrei.avk, 2021-08-09 01:02
PR 31992 merged miss-islington, 2022-03-19 12:27
PR 31993 merged miss-islington, 2022-03-19 12:27
Messages (10)
msg396817 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-07-01 16:24
https://docs.python.org/3.11/library/textwrap.html

The 3 functions - wrap, fill, shorten -- have a signature like `(..., **kwargs)`, where kwargs are instance attrs of TextWrap. It would be better to list all possible args in the signature because:

 - more convenient for users rather than scrolling back and forth between description of the function and the list under TextWrap

 - the list under TextWrap is so long it doesn't fit on one screen. It would be great to have a compact list in the signature of these 3 functions

 - it's confusing -- at first sight, it seems like **kwargs will be taken in to be used by a subclass or maybe stored as attrs on the instance and not used, and it seems like arbitrary kwargs can be given.

 - the only reason it was done so, I guess, is that the list is long and unwieldy. But that's also the reason why the listing under TextWrap takes up more than a screenful and so more of an argument to have a compact list in the signature.

 - in case of fill, some args are a no-op, so they can be omitted from the signature, that will make it much easier to see all effective arguments.
msg396818 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-07-01 16:33
Additionally, I think this issue contributes to likelihood of people running into https://bugs.python.org/issue43518 or similar issues with these 3 functions.
msg396831 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-07-01 22:50
> - in case of fill, some args are a no-op, so they can be omitted from the signature, that will make it much easier to see all effective arguments.

I was mistaken here, this applies to `shorten`, not to `fill` func.
msg398395 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-07-28 15:15
New changeset c1e39d6b1167376fdaf3f288ba9a689e61c7fdd1 by Jack DeVries in branch 'main':
bpo-44544: [doc] list all textwrap func kwargs (GH-26999)
https://github.com/python/cpython/commit/c1e39d6b1167376fdaf3f288ba9a689e61c7fdd1
msg398403 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-07-28 17:29
New changeset 97af790495f580a60253f9d8c50b26eeb53d9926 by Miss Islington (bot) in branch '3.10':
bpo-44544: [doc] list all textwrap func kwargs (GH-26999) (GH-27424)
https://github.com/python/cpython/commit/97af790495f580a60253f9d8c50b26eeb53d9926
msg398404 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-07-28 17:29
New changeset 019a8b08fa28b26e009fd10395c7b767848b4e77 by Miss Islington (bot) in branch '3.9':
bpo-44544: [doc] list all textwrap func kwargs (GH-26999) (GH-27425)
https://github.com/python/cpython/commit/019a8b08fa28b26e009fd10395c7b767848b4e77
msg398405 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-07-28 17:30
Thanks! ✨ 🍰 ✨
msg415546 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2022-03-19 12:27
New changeset cb7874f49d3d55df73a3c529773af14e2e344fb7 by andrei kulakov in branch 'main':
bpo-44544: add textwrap placeholder arg (GH-27671)
https://github.com/python/cpython/commit/cb7874f49d3d55df73a3c529773af14e2e344fb7
msg415547 - (view) Author: miss-islington (miss-islington) Date: 2022-03-19 12:48
New changeset c1f327f30db09388fc777196e233b7a6182c6efa by Miss Islington (bot) in branch '3.10':
bpo-44544: add textwrap placeholder arg (GH-27671)
https://github.com/python/cpython/commit/c1f327f30db09388fc777196e233b7a6182c6efa
msg415548 - (view) Author: miss-islington (miss-islington) Date: 2022-03-19 12:54
New changeset fcd57996899569ec6b8028bc5b75f973f7074e21 by Miss Islington (bot) in branch '3.9':
bpo-44544: add textwrap placeholder arg (GH-27671)
https://github.com/python/cpython/commit/fcd57996899569ec6b8028bc5b75f973f7074e21
History
Date User Action Args
2022-04-11 14:59:47adminsetgithub: 88710
2022-03-19 12:54:15miss-islingtonsetmessages: + msg415548
2022-03-19 12:48:02miss-islingtonsetmessages: + msg415547
2022-03-19 12:27:49miss-islingtonsetpull_requests: + pull_request30083
2022-03-19 12:27:44miss-islingtonsetpull_requests: + pull_request30082
2022-03-19 12:27:42asvetlovsetnosy: + asvetlov
messages: + msg415546
2021-08-09 01:02:48andrei.avksetpull_requests: + pull_request26159
2021-07-28 17:30:27lukasz.langasetstatus: open -> closed
resolution: fixed
messages: + msg398405

stage: patch review -> resolved
2021-07-28 17:29:51lukasz.langasetmessages: + msg398404
2021-07-28 17:29:41lukasz.langasetmessages: + msg398403
2021-07-28 15:15:10miss-islingtonsetpull_requests: + pull_request25954
2021-07-28 15:15:04miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request25953
2021-07-28 15:15:02lukasz.langasetnosy: + lukasz.langa
messages: + msg398395
2021-07-02 17:57:02jack__dsetkeywords: + patch
nosy: + jack__d

pull_requests: + pull_request25559
stage: patch review
2021-07-01 22:50:16andrei.avksetmessages: + msg396831
2021-07-01 16:33:12andrei.avksetmessages: + msg396818
2021-07-01 16:24:19andrei.avkcreate