From 250ad613f3ae7e237e28d3a7a15a9b6fac16129f Mon Sep 17 00:00:00 2001 From: "Martin v. Löwis" Date: Mon, 7 Apr 2008 05:43:42 +0000 Subject: Bug #2565: The repr() of type objects now calls them 'class', not 'type' - whether they are builtin types or not. --- Lib/test/test_generators.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'Lib/test/test_generators.py') diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index 04f13590dfd..992126ff05d 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -377,10 +377,10 @@ From the Iterators list, about the types of these things. ... yield 1 ... >>> type(g) - + >>> i = g() >>> type(i) - + >>> [s for s in dir(i) if not s.startswith('_')] ['close', 'gi_code', 'gi_frame', 'gi_running', 'send', 'throw'] >>> print(i.__next__.__doc__) @@ -396,7 +396,7 @@ And more, added later. >>> i.gi_running 0 >>> type(i.gi_frame) - + >>> i.gi_running = 42 Traceback (most recent call last): ... @@ -794,27 +794,27 @@ These are fine: >>> def f(): ... yield >>> type(f()) - + >>> def f(): ... if 0: ... yield >>> type(f()) - + >>> def f(): ... if 0: ... yield 1 >>> type(f()) - + >>> def f(): ... if "": ... yield None >>> type(f()) - + >>> def f(): ... return @@ -838,7 +838,7 @@ These are fine: ... x = 1 ... return >>> type(f()) - + >>> def f(): ... if 0: @@ -846,7 +846,7 @@ These are fine: ... yield 1 ... >>> type(f()) - + >>> def f(): ... if 0: @@ -856,7 +856,7 @@ These are fine: ... def f(self): ... yield 2 >>> type(f()) - + >>> def f(): ... if 0: @@ -864,7 +864,7 @@ These are fine: ... if 0: ... yield 2 >>> type(f()) - + >>> def f(): @@ -1512,7 +1512,7 @@ And a more sane, but still weird usage: >>> def f(): list(i for i in [(yield 26)]) >>> type(f()) - + A yield expression with augmented assignment. @@ -1749,25 +1749,25 @@ enclosing function a generator: >>> def f(): x += yield >>> type(f()) - + >>> def f(): x = yield >>> type(f()) - + >>> def f(): lambda x=(yield): 1 >>> type(f()) - + >>> def f(): x=(i for i in (yield) if (yield)) >>> type(f()) - + >>> def f(d): d[(yield "a")] = d[(yield "b")] = 27 >>> data = [1,2] >>> g = f(data) >>> type(g) - + >>> g.send(None) 'a' >>> data -- cgit v1.2.3