➜

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.

作者 r.david.murray
收信人 chris.jerdonek, ethan.furman, gward, jcea, pitrou, r.david.murray, twouters
日期 2012-08-04.19:50:12
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1344109813.49.0.389242355348.issue15510@psf.upfronthosting.co.za>
In-reply-to
内容
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.
历史
日期 用户 动作 参数
2012-08-04 19:50:13r.david.murray修改recipients: + r.david.murray, twouters, gward, jcea, pitrou, chris.jerdonek, ethan.furman
2012-08-04 19:50:13r.david.murray修改messageid: <1344109813.49.0.389242355348.issue15510@psf.upfronthosting.co.za>
2012-08-04 19:50:12r.david.murray链接issue15510 messages
2012-08-04 19:50:12r.david.murray创建