summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-14 03:33:52 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-01-14 03:33:52 (GMT)
commit9c2019632b9e775dcc8ae259b5028f9824265c6a (patch)
tree94ea94c9ddf7b916ddd2ff55da72c0c895fbe713 /Lib
parent7cdf5f5c318869a7cfa1deaeefb2a7f07244c62e (diff)
downloadcpython-9c2019632b9e775dcc8ae259b5028f9824265c6a.zip
cpython-9c2019632b9e775dcc8ae259b5028f9824265c6a.tar.gz
cpython-9c2019632b9e775dcc8ae259b5028f9824265c6a.tar.bz2
Added new an better structseq representation. E.g. repr(time.gmtime(0)) now returns 'time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0)' instead of '(1970, 1, 1, 0, 0, 0, 3, 1, 0)'. The feature is part of #1816: sys.flags
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_structseq.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_structseq.py b/Lib/test/test_structseq.py
index 1af0583..83c7ccf 100644
--- a/Lib/test/test_structseq.py
+++ b/Lib/test/test_structseq.py
@@ -28,7 +28,11 @@ class StructSeqTest(unittest.TestCase):
def test_repr(self):
t = time.gmtime()
- repr(t)
+ self.assert_(repr(t))
+ t = time.gmtime(0)
+ self.assertEqual(repr(t),
+ "time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, "
+ "tm_min=0, tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0)")
def test_concat(self):
t1 = time.gmtime()