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.

Author r.david.murray
Recipients chris.jerdonek, ethan.furman, gward, jcea, pitrou, r.david.murray, twouters
Date 2012-08-04.19:50:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
FTR I agree with Antoine that returning the empty list is the more logical behavior here.  Wrap is turning a string into a list of lines...if there is no content, the list of lines *should* be empty, IMO.  That is what I would expect, so for me the empty list follows the principle of least surprise here.  Consider, for example, the fact that [] is False, while [''] is True.  I consider that definitive in favor of returning an empty list when there is no content to wrap, even ignoring the backward compatibility issue.

The issue of preserving whitespace-only is fuzzier, but given that it is fuzzy I also am inclined to leave the current behavior alone (and document it properly).  As Antoine said, there is no point in preserving whitespace unless it is preserving indentation, and if there is nothing but whitespace there is nothing to be indented.
Date User Action Args
2012-08-04 19:50:13r.david.murraysetrecipients: + r.david.murray, twouters, gward, jcea, pitrou, chris.jerdonek, ethan.furman
2012-08-04 19:50:13r.david.murraysetmessageid: <>
2012-08-04 19:50:12r.david.murraylinkissue15510 messages
2012-08-04 19:50:12r.david.murraycreate