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

textwrap handling of hyphenation #46911

Closed
fourmanoit mannequin opened this issue Apr 19, 2008 · 5 comments
Closed

textwrap handling of hyphenation #46911

fourmanoit mannequin opened this issue Apr 19, 2008 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@fourmanoit
Copy link
Mannequin

fourmanoit mannequin commented Apr 19, 2008

BPO 2659
Nosy @birkenfeld, @pitrou
Files
  • textwrap_break_on_hyphens.patch
  • textwrap_break_on_hyphens_2.patch
  • textwrap_hyphens_doc.patch
  • 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 = 'https://github.com/birkenfeld'
    closed_at = <Date 2008-05-11.10:42:51.671>
    created_at = <Date 2008-04-19.20:00:57.537>
    labels = ['library']
    title = 'textwrap handling of hyphenation'
    updated_at = <Date 2008-05-11.10:42:51.670>
    user = 'https://bugs.python.org/fourmanoit'

    bugs.python.org fields:

    activity = <Date 2008-05-11.10:42:51.670>
    actor = 'georg.brandl'
    assignee = 'georg.brandl'
    closed = True
    closed_date = <Date 2008-05-11.10:42:51.671>
    closer = 'georg.brandl'
    components = ['Library (Lib)']
    creation = <Date 2008-04-19.20:00:57.537>
    creator = 'fourmanoit'
    dependencies = []
    files = ['10062', '10067', '10068']
    hgrepos = []
    issue_num = 2659
    keywords = ['patch']
    message_count = 5.0
    messages = ['65635', '65636', '65653', '65654', '66618']
    nosy_count = 3.0
    nosy_names = ['georg.brandl', 'pitrou', 'fourmanoit']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue2659'
    versions = ['Python 2.6']

    @fourmanoit
    Copy link
    Mannequin Author

    fourmanoit mannequin commented Apr 19, 2008

    The textwrap module in standard library breaks hyphenated words given
    the opportunity; I don't think that's absolutely obvious from the
    current doc, and it's something worth mentioning.

    Here is a short addition to the library reference guide.

    Initial discussion started here:
    http://mail.python.org/pipermail/stdlib-sig/2008-April/000265.html

    @fourmanoit fourmanoit mannequin added the stdlib Python modules in the Lib dir label Apr 19, 2008
    @fourmanoit
    Copy link
    Mannequin Author

    fourmanoit mannequin commented Apr 19, 2008

    I also think it would be nice if a public interface to completely avoid
    breaking hyphenated words would be included; patch included: it's pretty
    light, and should have no impact on any code currently using textwrap.

    @pitrou
    Copy link
    Member

    pitrou commented Apr 20, 2008

    Two things:

    • I think the added argument should come at the end of the argument
      list, so that code currently passing drop_whitespace positionally
      isn't broken by the change
    • it would be nice to have unit tests

    @fourmanoit
    Copy link
    Mannequin Author

    fourmanoit mannequin commented Apr 20, 2008

    Thanks for the feedback. Enclosed patch:

    • moves the added "break_on_hyphens" argument at the end of the argument
      list
    • adds a unit test for the new attribute

    @birkenfeld
    Copy link
    Member

    Thanks for the patch! Reviewed and committed as r63053.

    @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
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants