Message26907
| Author |
gward |
| Recipients |
| Date |
2006年06月11日.00:41:01 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
Logged In: YES
user_id=14422
I agree that the docs are (pretty) clear and the code is
wrong. When determining common leading whitespace, tabs and
spaces should *not* be treated as equivalent.
Raymond's fix was close, but not quite there: considering
only the length of leading whitespace still causes space/tab
confusion. (This only became clear to me after I wrote
several test cases.)
My fix is based on Raymond's, i.e. it uses regexes for most
of the heavy lifting rather than splitting the input string
on newline and looping over the lines. The bit that's
different is determining what exactly is the common leading
whitespace string. Anyways, this ended up being a complete
rewrite of dedent(). I also added a paragraph to the docs
to clarify the distinction between tabs and spaces.
Checked in under rev 46844 (trunk only). |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 14:36:20 | admin | link | issue1361643 messages |
| 2007年08月23日 14:36:20 | admin | create |
|