diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-04-07 05:43:42 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-04-07 05:43:42 (GMT) |
commit | 250ad613f3ae7e237e28d3a7a15a9b6fac16129f (patch) | |
tree | 5484e62a1ee0b0d9b7008cad32ab33392db7e78e /Lib/test/test_generators.py | |
parent | 5a6f4585fdc52959bcc0dfdb9d25f2d34f983300 (diff) | |
download | cpython-250ad613f3ae7e237e28d3a7a15a9b6fac16129f.zip cpython-250ad613f3ae7e237e28d3a7a15a9b6fac16129f.tar.gz cpython-250ad613f3ae7e237e28d3a7a15a9b6fac16129f.tar.bz2 |
Bug #2565: The repr() of type objects now calls them 'class',
not 'type' - whether they are builtin types or not.
Diffstat (limited to 'Lib/test/test_generators.py')
-rw-r--r-- | Lib/test/test_generators.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index 04f1359..992126f 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) -<type 'function'> +<class 'function'> >>> i = g() >>> type(i) -<type 'generator'> +<class 'generator'> >>> [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) -<type 'frame'> +<class 'frame'> >>> i.gi_running = 42 Traceback (most recent call last): ... @@ -794,27 +794,27 @@ These are fine: >>> def f(): ... yield >>> type(f()) -<type 'generator'> +<class 'generator'> >>> def f(): ... if 0: ... yield >>> type(f()) -<type 'generator'> +<class 'generator'> >>> def f(): ... if 0: ... yield 1 >>> type(f()) -<type 'generator'> +<class 'generator'> >>> def f(): ... if "": ... yield None >>> type(f()) -<type 'generator'> +<class 'generator'> >>> def f(): ... return @@ -838,7 +838,7 @@ These are fine: ... x = 1 ... return >>> type(f()) -<type 'generator'> +<class 'generator'> >>> def f(): ... if 0: @@ -846,7 +846,7 @@ These are fine: ... yield 1 ... >>> type(f()) -<type 'NoneType'> +<class 'NoneType'> >>> def f(): ... if 0: @@ -856,7 +856,7 @@ These are fine: ... def f(self): ... yield 2 >>> type(f()) -<type 'NoneType'> +<class 'NoneType'> >>> def f(): ... if 0: @@ -864,7 +864,7 @@ These are fine: ... if 0: ... yield 2 >>> type(f()) -<type 'generator'> +<class 'generator'> >>> 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()) -<type 'generator'> +<class 'generator'> A yield expression with augmented assignment. @@ -1749,25 +1749,25 @@ enclosing function a generator: >>> def f(): x += yield >>> type(f()) -<type 'generator'> +<class 'generator'> >>> def f(): x = yield >>> type(f()) -<type 'generator'> +<class 'generator'> >>> def f(): lambda x=(yield): 1 >>> type(f()) -<type 'generator'> +<class 'generator'> >>> def f(): x=(i for i in (yield) if (yield)) >>> type(f()) -<type 'generator'> +<class 'generator'> >>> def f(d): d[(yield "a")] = d[(yield "b")] = 27 >>> data = [1,2] >>> g = f(data) >>> type(g) -<type 'generator'> +<class 'generator'> >>> g.send(None) 'a' >>> data |