André <[EMAIL PROTECTED]> writes:

 > Ok, doctest-based version of the Unit test example added; so much
 > more Pythonic ;-)

Sorry for being a bit picky but there are a number of things that I'm
unhappy with in that example.

1) It's the second example with 13 lines.  Though I suppose that the
   pragmatism of pairing the examples overriding an implicit goal of
   the page is itself Pythonic.

2) assert is not the simplest example of doctest.  The style should be

    >>> add_money([0.13, 0.02])
    0.15
    >>> add_money([100.01, 99.99])
    200.0
    >>> add_money([0, -13.00, 13.00])
    0.0

3) which fails :-(  So both the unittest and doctest examples ought to
   be redone to emphasize what they are doing without getting bogged
   down by issues of floating point representations.

http://wiki.python.org/moin/SimplePrograms

-- 
Pete Forman                -./\.-  Disclaimer: This post is originated
WesternGeco                  -./\.-   by myself and does not represent
[EMAIL PROTECTED]    -./\.-   the opinion of Schlumberger or
http://petef.port5.com           -./\.-   WesternGeco.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to