[issue44544] Add full list of possible args to textwrap: wrap, fill, shorten
New submission from Andrei Kulakov <andrei.avk@gmail.com>: 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. ---------- assignee: docs@python components: Documentation messages: 396817 nosy: andrei.avk, docs@python priority: normal severity: normal status: open title: Add full list of possible args to textwrap: wrap, fill, shorten type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
Andrei Kulakov <andrei.avk@gmail.com> added the comment: Additionally, I think this issue contributes to likelihood of people running into https://bugs.python.org/issue43518 or similar issues with these 3 functions. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
Andrei Kulakov <andrei.avk@gmail.com> added the comment:
- 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. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
Change by Jack DeVries <jdevries3133@gmail.com>: ---------- keywords: +patch nosy: +jack__d nosy_count: 2.0 -> 3.0 pull_requests: +25559 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26999 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
Łukasz Langa <lukasz@langa.pl> added the comment: 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/c1e39d6b1167376fdaf3f288ba9a689e61c... ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25953 pull_request: https://github.com/python/cpython/pull/27424 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +25954 pull_request: https://github.com/python/cpython/pull/27425 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
Łukasz Langa <lukasz@langa.pl> added the comment: 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/97af790495f580a60253f9d8c50b26eeb53... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
Łukasz Langa <lukasz@langa.pl> added the comment: 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/019a8b08fa28b26e009fd10395c7b767848... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
Łukasz Langa <lukasz@langa.pl> added the comment: Thanks! ✨ 🍰 ✨ ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
Change by Andrei Kulakov <andrei.avk@gmail.com>: ---------- pull_requests: +26159 pull_request: https://github.com/python/cpython/pull/27671 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
Andrew Svetlov <andrew.svetlov@gmail.com> added the comment: New changeset cb7874f49d3d55df73a3c529773af14e2e344fb7 by andrei kulakov in branch 'main': bpo-44544: add textwrap placeholder arg (GH-27671) https://github.com/python/cpython/commit/cb7874f49d3d55df73a3c529773af14e2e3... ---------- nosy: +asvetlov _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +30082 pull_request: https://github.com/python/cpython/pull/31992 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +30083 pull_request: https://github.com/python/cpython/pull/31993 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: 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/c1f327f30db09388fc777196e233b7a6182... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: 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/fcd57996899569ec6b8028bc5b75f973f70... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue44544> _______________________________________
participants (5)
-
Andrei Kulakov
-
Andrew Svetlov
-
Jack DeVries
-
miss-islington
-
Łukasz Langa