Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add full list of possible args to textwrap: wrap, fill, shorten #88710

Closed
akulakov opened this issue Jul 1, 2021 · 10 comments
Closed

Add full list of possible args to textwrap: wrap, fill, shorten #88710

akulakov opened this issue Jul 1, 2021 · 10 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@akulakov
Copy link
Contributor

akulakov commented Jul 1, 2021

BPO 44544
Nosy @asvetlov, @ambv, @miss-islington, @akulakov, @jdevries3133
PRs
  • bpo-44544: [doc] list all textwrap func kwargs #26999
  • [3.10] bpo-44544: [doc] list all textwrap func kwargs (GH-26999) #27424
  • [3.9] bpo-44544: [doc] list all textwrap func kwargs (GH-26999) #27425
  • bpo-44544: add textwrap placeholder arg #27671
  • [3.10] bpo-44544: add textwrap placeholder arg (GH-27671) #31992
  • [3.9] bpo-44544: add textwrap placeholder arg (GH-27671) #31993
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-07-28.17:30:27.775>
    created_at = <Date 2021-07-01.16:24:18.989>
    labels = ['3.11', 'type-feature', '3.9', '3.10', 'docs']
    title = 'Add full list of possible args to textwrap: wrap, fill, shorten'
    updated_at = <Date 2022-03-19.12:54:15.533>
    user = 'https://github.com/akulakov'

    bugs.python.org fields:

    activity = <Date 2022-03-19.12:54:15.533>
    actor = 'miss-islington'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2021-07-28.17:30:27.775>
    closer = 'lukasz.langa'
    components = ['Documentation']
    creation = <Date 2021-07-01.16:24:18.989>
    creator = 'andrei.avk'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44544
    keywords = ['patch']
    message_count = 10.0
    messages = ['396817', '396818', '396831', '398395', '398403', '398404', '398405', '415546', '415547', '415548']
    nosy_count = 6.0
    nosy_names = ['asvetlov', 'docs@python', 'lukasz.langa', 'miss-islington', 'andrei.avk', 'jack__d']
    pr_nums = ['26999', '27424', '27425', '27671', '31992', '31993']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue44544'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @akulakov
    Copy link
    Contributor Author

    akulakov commented Jul 1, 2021

    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.

    @akulakov akulakov added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Jul 1, 2021
    @akulakov akulakov added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Jul 1, 2021
    @akulakov
    Copy link
    Contributor Author

    akulakov commented Jul 1, 2021

    Additionally, I think this issue contributes to likelihood of people running into https://bugs.python.org/issue43518 or similar issues with these 3 functions.

    @akulakov
    Copy link
    Contributor Author

    akulakov commented Jul 1, 2021

    • 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.

    @ambv
    Copy link
    Contributor

    ambv commented Jul 28, 2021

    New changeset c1e39d6 by Jack DeVries in branch 'main':
    bpo-44544: [doc] list all textwrap func kwargs (GH-26999)
    c1e39d6

    @ambv
    Copy link
    Contributor

    ambv commented Jul 28, 2021

    New changeset 97af790 by Miss Islington (bot) in branch '3.10':
    bpo-44544: [doc] list all textwrap func kwargs (GH-26999) (GH-27424)
    97af790

    @ambv
    Copy link
    Contributor

    ambv commented Jul 28, 2021

    New changeset 019a8b0 by Miss Islington (bot) in branch '3.9':
    bpo-44544: [doc] list all textwrap func kwargs (GH-26999) (GH-27425)
    019a8b0

    @ambv
    Copy link
    Contributor

    ambv commented Jul 28, 2021

    Thanks! ✨ 🍰 ✨

    @ambv ambv closed this as completed Jul 28, 2021
    @asvetlov
    Copy link
    Contributor

    New changeset cb7874f by andrei kulakov in branch 'main':
    bpo-44544: add textwrap placeholder arg (GH-27671)
    cb7874f

    @miss-islington
    Copy link
    Contributor

    New changeset c1f327f by Miss Islington (bot) in branch '3.10':
    bpo-44544: add textwrap placeholder arg (GH-27671)
    c1f327f

    @miss-islington
    Copy link
    Contributor

    New changeset fcd5799 by Miss Islington (bot) in branch '3.9':
    bpo-44544: add textwrap placeholder arg (GH-27671)
    fcd5799

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants