Message167435
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:13 | r.david.murray | set | recipients:
+ r.david.murray, twouters, gward, jcea, pitrou, chris.jerdonek, ethan.furman |
2012-08-04 19:50:13 | r.david.murray | set | messageid: <1344109813.49.0.389242355348.issue15510@psf.upfronthosting.co.za> |
2012-08-04 19:50:12 | r.david.murray | link | issue15510 messages |
2012-08-04 19:50:12 | r.david.murray | create | |
|