diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-01-13 19:19:16 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-01-15 02:15:38 +0200 |
commit | 76d982ef343dcadd35355aed9c568984c850fb7b (patch) | |
tree | 1ded5f199ce740d3b72c00cc1e9c2b402936632f /tests | |
parent | 24224d7c72e1d6572ef0d24f08eb882dcac8dc50 (diff) | |
download | micropython-76d982ef343dcadd35355aed9c568984c850fb7b.tar.gz micropython-76d982ef343dcadd35355aed9c568984c850fb7b.zip |
type->print(): Distinguish str() and repr() variety by passing extra param.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basics/tests/exception1.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/basics/tests/exception1.py b/tests/basics/tests/exception1.py index 95d933de76..93d2cbfb92 100644 --- a/tests/basics/tests/exception1.py +++ b/tests/basics/tests/exception1.py @@ -1,3 +1,9 @@ -# TODO: requires repr() -#a = IndexError(1, "test", [100, 200]) -#print(repr(a)) +print(repr(IndexError())) +print(str(IndexError())) + +print(repr(IndexError("foo"))) +print(str(IndexError("foo"))) + +a = IndexError(1, "test", [100, 200]) +print(str(a)) +print(repr(a)) |