Traling white space on program source lines (was: Simple Doc Test failing without any reason [Help Needed])

Ben Finney bignose+hates-spam at benfinney.id.au
Wed May 28 18:01:55 EDT 2008


afrobeard <afrobeard at gmail.com> writes:

> >>> sanitize_number('0321-4683113')<There were some spaces in these angle brackets>
> 
> Apparently they caused the test case to fail on this.
> 
> Weird behavior :/

Nope, exactly as specified: doctest is reporting differences berween
what output was generated and what output you described.

> Thanks for your time Gerard and thanks to everyone else too.

Moral of the story: Configure your editor to highlight trailing space
on a line as an error, and always remove it before saving a program
source code file.

-- 
 \       “Men never do evil so completely and cheerfully as when they |
  `\                 do it from religious conviction.” —Blaise Pascal |
_o__)                                     (1623-1662), Pensées, #894. |
Ben Finney



More information about the Python-list mailing list