eval(repr(x)) == x

Aahz Maruch aahz at panix.com
Sun Jan 27 11:41:09 EST 2002


In article <mailman.1012145585.13986.python-list at python.org>,
Alex Martelli  <aleax at aleax.it> wrote:
>
>I still can't see it.  I generally use doctest for unit tests, and it does 
>lend itself to working that way (just cutting and pasting an interactive
>session) without dependency on eval and repr being inverse.  The
>*only* p.i.t.a with doctest is that with every Python release the exact
>wording of some exception or other changes, so that all tests that
>involve that exception "break" until they've been 'fixed' to reflect the
>wording in the new version (and then you can't run them under the
>previous version any more) -- basically it's very impractical for test
>suites intended to survive from one Python version to the next, or
>work across two Python versions.  But that wouldn't be fixed by any
>change to repr...

Heh.  That's (part of) why I'm using my own exceptions.
-- 
                      --- Aahz  <*>  (Copyright 2002 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

"I support family values -- Addams family values" --www.nancybuttons.com



More information about the Python-list mailing list