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: textwrap handling of hyphenation
Type: Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: fourmanoit, georg.brandl, pitrou
Priority: normal Keywords: patch

Created on 2008-04-19 20:00 by fourmanoit, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
textwrap_break_on_hyphens.patch fourmanoit, 2008-04-19 20:07
textwrap_break_on_hyphens_2.patch fourmanoit, 2008-04-20 23:41
textwrap_hyphens_doc.patch fourmanoit, 2008-04-20 23:44
Messages (5)
msg65635 - (view) Author: Sylvain Fourmanoit (fourmanoit) Date: 2008-04-19 20:00
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
msg65636 - (view) Author: Sylvain Fourmanoit (fourmanoit) Date: 2008-04-19 20:07
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.
msg65653 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-04-20 23:03
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
msg65654 - (view) Author: Sylvain Fourmanoit (fourmanoit) Date: 2008-04-20 23:41
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
msg66618 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-05-11 10:42
Thanks for the patch! Reviewed and committed as r63053.
History
Date User Action Args
2022-04-11 14:56:33adminsetgithub: 46911
2008-05-11 10:42:51georg.brandlsetstatus: open -> closed
resolution: accepted
messages: + msg66618
2008-04-20 23:44:11fourmanoitsetfiles: + textwrap_hyphens_doc.patch
2008-04-20 23:43:41fourmanoitsetfiles: - textwrap_hyphens_doc.patch
2008-04-20 23:41:19fourmanoitsetfiles: + textwrap_break_on_hyphens_2.patch
messages: + msg65654
2008-04-20 23:03:41pitrousetnosy: + pitrou
messages: + msg65653
2008-04-19 20:16:46benjamin.petersonsetassignee: georg.brandl
nosy: + georg.brandl
2008-04-19 20:07:29fourmanoitsetfiles: + textwrap_break_on_hyphens.patch
messages: + msg65636
2008-04-19 20:00:57fourmanoitcreate