ofs | hex dump | ascii |
---|
0000 | 03 f3 0d 0a 50 5c ac 51 63 00 00 00 00 00 00 00 00 03 00 00 00 40 00 00 00 73 3f 00 00 00 64 00 | ....P\.Qc............@...s?...d. |
0020 | 00 5a 00 00 69 01 00 65 00 00 64 01 00 36 5a 01 00 64 05 00 64 02 00 84 01 00 5a 03 00 65 04 00 | .Z..i..e..d..6Z..d..d.....Z..e.. |
0040 | 64 03 00 6b 02 00 72 3b 00 65 03 00 64 04 00 65 05 00 83 00 01 01 6e 00 00 64 05 00 53 28 06 00 | d..k..r;.e..d..e......n..d..S(.. |
0060 | 00 00 73 99 1a 00 00 0a 0a 54 65 73 74 20 73 69 6d 70 6c 65 20 6c 6f 6f 70 20 77 69 74 68 20 63 | ..s......Test.simple.loop.with.c |
0080 | 6f 6e 64 69 74 69 6f 6e 61 6c 0a 0a 20 20 20 20 3e 3e 3e 20 73 75 6d 28 69 2a 69 20 66 6f 72 20 | onditional......>>>.sum(i*i.for. |
00a0 | 69 20 69 6e 20 72 61 6e 67 65 28 31 30 30 29 20 69 66 20 69 26 31 20 3d 3d 20 31 29 0a 20 20 20 | i.in.range(100).if.i&1.==.1).... |
00c0 | 20 31 36 36 36 35 30 0a 0a 54 65 73 74 20 73 69 6d 70 6c 65 20 6e 65 73 74 69 6e 67 0a 0a 20 20 | .166650..Test.simple.nesting.... |
00e0 | 20 20 3e 3e 3e 20 6c 69 73 74 28 28 69 2c 6a 29 20 66 6f 72 20 69 20 69 6e 20 72 61 6e 67 65 28 | ..>>>.list((i,j).for.i.in.range( |
0100 | 33 29 20 66 6f 72 20 6a 20 69 6e 20 72 61 6e 67 65 28 34 29 20 29 0a 20 20 20 20 5b 28 30 2c 20 | 3).for.j.in.range(4).).....[(0,. |
0120 | 30 29 2c 20 28 30 2c 20 31 29 2c 20 28 30 2c 20 32 29 2c 20 28 30 2c 20 33 29 2c 20 28 31 2c 20 | 0),.(0,.1),.(0,.2),.(0,.3),.(1,. |
0140 | 30 29 2c 20 28 31 2c 20 31 29 2c 20 28 31 2c 20 32 29 2c 20 28 31 2c 20 33 29 2c 20 28 32 2c 20 | 0),.(1,.1),.(1,.2),.(1,.3),.(2,. |
0160 | 30 29 2c 20 28 32 2c 20 31 29 2c 20 28 32 2c 20 32 29 2c 20 28 32 2c 20 33 29 5d 0a 0a 54 65 73 | 0),.(2,.1),.(2,.2),.(2,.3)]..Tes |
0180 | 74 20 6e 65 73 74 69 6e 67 20 77 69 74 68 20 74 68 65 20 69 6e 6e 65 72 20 65 78 70 72 65 73 73 | t.nesting.with.the.inner.express |
01a0 | 69 6f 6e 20 64 65 70 65 6e 64 65 6e 74 20 6f 6e 20 74 68 65 20 6f 75 74 65 72 0a 0a 20 20 20 20 | ion.dependent.on.the.outer...... |
01c0 | 3e 3e 3e 20 6c 69 73 74 28 28 69 2c 6a 29 20 66 6f 72 20 69 20 69 6e 20 72 61 6e 67 65 28 34 29 | >>>.list((i,j).for.i.in.range(4) |
01e0 | 20 66 6f 72 20 6a 20 69 6e 20 72 61 6e 67 65 28 69 29 20 29 0a 20 20 20 20 5b 28 31 2c 20 30 29 | .for.j.in.range(i).).....[(1,.0) |
0200 | 2c 20 28 32 2c 20 30 29 2c 20 28 32 2c 20 31 29 2c 20 28 33 2c 20 30 29 2c 20 28 33 2c 20 31 29 | ,.(2,.0),.(2,.1),.(3,.0),.(3,.1) |
0220 | 2c 20 28 33 2c 20 32 29 5d 0a 0a 4d 61 6b 65 20 73 75 72 65 20 74 68 65 20 69 6e 64 75 63 74 69 | ,.(3,.2)]..Make.sure.the.inducti |
0240 | 6f 6e 20 76 61 72 69 61 62 6c 65 20 69 73 20 6e 6f 74 20 65 78 70 6f 73 65 64 0a 0a 20 20 20 20 | on.variable.is.not.exposed...... |
0260 | 3e 3e 3e 20 69 20 3d 20 32 30 0a 20 20 20 20 3e 3e 3e 20 73 75 6d 28 69 2a 69 20 66 6f 72 20 69 | >>>.i.=.20.....>>>.sum(i*i.for.i |
0280 | 20 69 6e 20 72 61 6e 67 65 28 31 30 30 29 29 0a 20 20 20 20 33 32 38 33 35 30 0a 20 20 20 20 3e | .in.range(100)).....328350.....> |
02a0 | 3e 3e 20 69 0a 20 20 20 20 32 30 0a 0a 54 65 73 74 20 66 69 72 73 74 20 63 6c 61 73 73 0a 0a 20 | >>.i.....20..Test.first.class... |
02c0 | 20 20 20 3e 3e 3e 20 67 20 3d 20 28 69 2a 69 20 66 6f 72 20 69 20 69 6e 20 72 61 6e 67 65 28 34 | ...>>>.g.=.(i*i.for.i.in.range(4 |
02e0 | 29 29 0a 20 20 20 20 3e 3e 3e 20 74 79 70 65 28 67 29 0a 20 20 20 20 3c 74 79 70 65 20 27 67 65 | )).....>>>.type(g).....<type.'ge |
0300 | 6e 65 72 61 74 6f 72 27 3e 0a 20 20 20 20 3e 3e 3e 20 6c 69 73 74 28 67 29 0a 20 20 20 20 5b 30 | nerator'>.....>>>.list(g).....[0 |
0320 | 2c 20 31 2c 20 34 2c 20 39 5d 0a 0a 54 65 73 74 20 64 69 72 65 63 74 20 63 61 6c 6c 73 20 74 6f | ,.1,.4,.9]..Test.direct.calls.to |
0340 | 20 6e 65 78 74 28 29 0a 0a 20 20 20 20 3e 3e 3e 20 67 20 3d 20 28 69 2a 69 20 66 6f 72 20 69 20 | .next()......>>>.g.=.(i*i.for.i. |
0360 | 69 6e 20 72 61 6e 67 65 28 33 29 29 0a 20 20 20 20 3e 3e 3e 20 67 2e 6e 65 78 74 28 29 0a 20 20 | in.range(3)).....>>>.g.next()... |
0380 | 20 20 30 0a 20 20 20 20 3e 3e 3e 20 67 2e 6e 65 78 74 28 29 0a 20 20 20 20 31 0a 20 20 20 20 3e | ..0.....>>>.g.next().....1.....> |
03a0 | 3e 3e 20 67 2e 6e 65 78 74 28 29 0a 20 20 20 20 34 0a 20 20 20 20 3e 3e 3e 20 67 2e 6e 65 78 74 | >>.g.next().....4.....>>>.g.next |
03c0 | 28 29 0a 20 20 20 20 54 72 61 63 65 62 61 63 6b 20 28 6d 6f 73 74 20 72 65 63 65 6e 74 20 63 61 | ().....Traceback.(most.recent.ca |
03e0 | 6c 6c 20 6c 61 73 74 29 3a 0a 20 20 20 20 20 20 46 69 6c 65 20 22 3c 70 79 73 68 65 6c 6c 23 32 | ll.last):.......File."<pyshell#2 |
0400 | 31 3e 22 2c 20 6c 69 6e 65 20 31 2c 20 69 6e 20 2d 74 6f 70 6c 65 76 65 6c 2d 0a 20 20 20 20 20 | 1>",.line.1,.in.-toplevel-...... |
0420 | 20 20 20 67 2e 6e 65 78 74 28 29 0a 20 20 20 20 53 74 6f 70 49 74 65 72 61 74 69 6f 6e 0a 0a 44 | ...g.next().....StopIteration..D |
0440 | 6f 65 73 20 69 74 20 73 74 61 79 20 73 74 6f 70 70 65 64 3f 0a 0a 20 20 20 20 3e 3e 3e 20 67 2e | oes.it.stay.stopped?......>>>.g. |
0460 | 6e 65 78 74 28 29 0a 20 20 20 20 54 72 61 63 65 62 61 63 6b 20 28 6d 6f 73 74 20 72 65 63 65 6e | next().....Traceback.(most.recen |
0480 | 74 20 63 61 6c 6c 20 6c 61 73 74 29 3a 0a 20 20 20 20 20 20 46 69 6c 65 20 22 3c 70 79 73 68 65 | t.call.last):.......File."<pyshe |
04a0 | 6c 6c 23 32 31 3e 22 2c 20 6c 69 6e 65 20 31 2c 20 69 6e 20 2d 74 6f 70 6c 65 76 65 6c 2d 0a 20 | ll#21>",.line.1,.in.-toplevel-.. |
04c0 | 20 20 20 20 20 20 20 67 2e 6e 65 78 74 28 29 0a 20 20 20 20 53 74 6f 70 49 74 65 72 61 74 69 6f | .......g.next().....StopIteratio |
04e0 | 6e 0a 20 20 20 20 3e 3e 3e 20 6c 69 73 74 28 67 29 0a 20 20 20 20 5b 5d 0a 0a 54 65 73 74 20 72 | n.....>>>.list(g).....[]..Test.r |
0500 | 75 6e 6e 69 6e 67 20 67 65 6e 20 77 68 65 6e 20 64 65 66 69 6e 69 6e 67 20 66 75 6e 63 74 69 6f | unning.gen.when.defining.functio |
0520 | 6e 20 69 73 20 6f 75 74 20 6f 66 20 73 63 6f 70 65 0a 0a 20 20 20 20 3e 3e 3e 20 64 65 66 20 66 | n.is.out.of.scope......>>>.def.f |
0540 | 28 6e 29 3a 0a 20 20 20 20 2e 2e 2e 20 20 20 20 20 72 65 74 75 72 6e 20 28 69 2a 69 20 66 6f 72 | (n):.............return.(i*i.for |
0560 | 20 69 20 69 6e 20 78 72 61 6e 67 65 28 6e 29 29 0a 20 20 20 20 3e 3e 3e 20 6c 69 73 74 28 66 28 | .i.in.xrange(n)).....>>>.list(f( |
0580 | 31 30 29 29 0a 20 20 20 20 5b 30 2c 20 31 2c 20 34 2c 20 39 2c 20 31 36 2c 20 32 35 2c 20 33 36 | 10)).....[0,.1,.4,.9,.16,.25,.36 |
05a0 | 2c 20 34 39 2c 20 36 34 2c 20 38 31 5d 0a 0a 20 20 20 20 3e 3e 3e 20 64 65 66 20 66 28 6e 29 3a | ,.49,.64,.81]......>>>.def.f(n): |
05c0 | 0a 20 20 20 20 2e 2e 2e 20 20 20 20 20 72 65 74 75 72 6e 20 28 28 69 2c 6a 29 20 66 6f 72 20 69 | .............return.((i,j).for.i |
05e0 | 20 69 6e 20 78 72 61 6e 67 65 28 33 29 20 66 6f 72 20 6a 20 69 6e 20 78 72 61 6e 67 65 28 6e 29 | .in.xrange(3).for.j.in.xrange(n) |
0600 | 29 0a 20 20 20 20 3e 3e 3e 20 6c 69 73 74 28 66 28 34 29 29 0a 20 20 20 20 5b 28 30 2c 20 30 29 | ).....>>>.list(f(4)).....[(0,.0) |
0620 | 2c 20 28 30 2c 20 31 29 2c 20 28 30 2c 20 32 29 2c 20 28 30 2c 20 33 29 2c 20 28 31 2c 20 30 29 | ,.(0,.1),.(0,.2),.(0,.3),.(1,.0) |
0640 | 2c 20 28 31 2c 20 31 29 2c 20 28 31 2c 20 32 29 2c 20 28 31 2c 20 33 29 2c 20 28 32 2c 20 30 29 | ,.(1,.1),.(1,.2),.(1,.3),.(2,.0) |
0660 | 2c 20 28 32 2c 20 31 29 2c 20 28 32 2c 20 32 29 2c 20 28 32 2c 20 33 29 5d 0a 20 20 20 20 3e 3e | ,.(2,.1),.(2,.2),.(2,.3)].....>> |
0680 | 3e 20 64 65 66 20 66 28 6e 29 3a 0a 20 20 20 20 2e 2e 2e 20 20 20 20 20 72 65 74 75 72 6e 20 28 | >.def.f(n):.............return.( |
06a0 | 28 69 2c 6a 29 20 66 6f 72 20 69 20 69 6e 20 78 72 61 6e 67 65 28 33 29 20 66 6f 72 20 6a 20 69 | (i,j).for.i.in.xrange(3).for.j.i |
06c0 | 6e 20 78 72 61 6e 67 65 28 34 29 20 69 66 20 6a 20 69 6e 20 78 72 61 6e 67 65 28 6e 29 29 0a 20 | n.xrange(4).if.j.in.xrange(n)).. |
06e0 | 20 20 20 3e 3e 3e 20 6c 69 73 74 28 66 28 34 29 29 0a 20 20 20 20 5b 28 30 2c 20 30 29 2c 20 28 | ...>>>.list(f(4)).....[(0,.0),.( |
0700 | 30 2c 20 31 29 2c 20 28 30 2c 20 32 29 2c 20 28 30 2c 20 33 29 2c 20 28 31 2c 20 30 29 2c 20 28 | 0,.1),.(0,.2),.(0,.3),.(1,.0),.( |
0720 | 31 2c 20 31 29 2c 20 28 31 2c 20 32 29 2c 20 28 31 2c 20 33 29 2c 20 28 32 2c 20 30 29 2c 20 28 | 1,.1),.(1,.2),.(1,.3),.(2,.0),.( |
0740 | 32 2c 20 31 29 2c 20 28 32 2c 20 32 29 2c 20 28 32 2c 20 33 29 5d 0a 20 20 20 20 3e 3e 3e 20 6c | 2,.1),.(2,.2),.(2,.3)].....>>>.l |
0760 | 69 73 74 28 66 28 32 29 29 0a 20 20 20 20 5b 28 30 2c 20 30 29 2c 20 28 30 2c 20 31 29 2c 20 28 | ist(f(2)).....[(0,.0),.(0,.1),.( |
0780 | 31 2c 20 30 29 2c 20 28 31 2c 20 31 29 2c 20 28 32 2c 20 30 29 2c 20 28 32 2c 20 31 29 5d 0a 0a | 1,.0),.(1,.1),.(2,.0),.(2,.1)].. |
07a0 | 56 65 72 69 66 79 20 74 68 61 74 20 70 61 72 65 6e 74 68 65 73 69 73 20 61 72 65 20 72 65 71 75 | Verify.that.parenthesis.are.requ |
07c0 | 69 72 65 64 20 69 6e 20 61 20 73 74 61 74 65 6d 65 6e 74 0a 0a 20 20 20 20 3e 3e 3e 20 64 65 66 | ired.in.a.statement......>>>.def |
07e0 | 20 66 28 6e 29 3a 0a 20 20 20 20 2e 2e 2e 20 20 20 20 20 72 65 74 75 72 6e 20 69 2a 69 20 66 6f | .f(n):.............return.i*i.fo |
0800 | 72 20 69 20 69 6e 20 78 72 61 6e 67 65 28 6e 29 0a 20 20 20 20 54 72 61 63 65 62 61 63 6b 20 28 | r.i.in.xrange(n).....Traceback.( |
0820 | 6d 6f 73 74 20 72 65 63 65 6e 74 20 63 61 6c 6c 20 6c 61 73 74 29 3a 0a 20 20 20 20 20 20 20 2e | most.recent.call.last):......... |
0840 | 2e 2e 0a 20 20 20 20 53 79 6e 74 61 78 45 72 72 6f 72 3a 20 69 6e 76 61 6c 69 64 20 73 79 6e 74 | .......SyntaxError:.invalid.synt |
0860 | 61 78 0a 0a 56 65 72 69 66 79 20 74 68 61 74 20 70 61 72 65 6e 74 68 65 73 69 73 20 61 72 65 20 | ax..Verify.that.parenthesis.are. |
0880 | 72 65 71 75 69 72 65 64 20 77 68 65 6e 20 75 73 65 64 20 61 73 20 61 20 6b 65 79 77 6f 72 64 20 | required.when.used.as.a.keyword. |
08a0 | 61 72 67 75 6d 65 6e 74 20 76 61 6c 75 65 0a 0a 20 20 20 20 3e 3e 3e 20 64 69 63 74 28 61 20 3d | argument.value......>>>.dict(a.= |
08c0 | 20 69 20 66 6f 72 20 69 20 69 6e 20 78 72 61 6e 67 65 28 31 30 29 29 0a 20 20 20 20 54 72 61 63 | .i.for.i.in.xrange(10)).....Trac |
08e0 | 65 62 61 63 6b 20 28 6d 6f 73 74 20 72 65 63 65 6e 74 20 63 61 6c 6c 20 6c 61 73 74 29 3a 0a 20 | eback.(most.recent.call.last):.. |
0900 | 20 20 20 20 20 20 2e 2e 2e 0a 20 20 20 20 53 79 6e 74 61 78 45 72 72 6f 72 3a 20 69 6e 76 61 6c | ..............SyntaxError:.inval |
0920 | 69 64 20 73 79 6e 74 61 78 0a 0a 56 65 72 69 66 79 20 74 68 61 74 20 70 61 72 65 6e 74 68 65 73 | id.syntax..Verify.that.parenthes |
0940 | 69 73 20 61 72 65 20 72 65 71 75 69 72 65 64 20 77 68 65 6e 20 75 73 65 64 20 61 73 20 61 20 6b | is.are.required.when.used.as.a.k |
0960 | 65 79 77 6f 72 64 20 61 72 67 75 6d 65 6e 74 20 76 61 6c 75 65 0a 0a 20 20 20 20 3e 3e 3e 20 64 | eyword.argument.value......>>>.d |
0980 | 69 63 74 28 61 20 3d 20 28 69 20 66 6f 72 20 69 20 69 6e 20 78 72 61 6e 67 65 28 31 30 29 29 29 | ict(a.=.(i.for.i.in.xrange(10))) |
09a0 | 20 23 64 6f 63 74 65 73 74 3a 20 2b 45 4c 4c 49 50 53 49 53 0a 20 20 20 20 7b 27 61 27 3a 20 3c | .#doctest:.+ELLIPSIS.....{'a':.< |
09c0 | 67 65 6e 65 72 61 74 6f 72 20 6f 62 6a 65 63 74 20 3c 67 65 6e 65 78 70 72 3e 20 61 74 20 2e 2e | generator.object.<genexpr>.at... |
09e0 | 2e 3e 7d 0a 0a 56 65 72 69 66 79 20 65 61 72 6c 79 20 62 69 6e 64 69 6e 67 20 66 6f 72 20 74 68 | .>}..Verify.early.binding.for.th |
0a00 | 65 20 6f 75 74 65 72 6d 6f 73 74 20 66 6f 72 2d 65 78 70 72 65 73 73 69 6f 6e 0a 0a 20 20 20 20 | e.outermost.for-expression...... |
0a20 | 3e 3e 3e 20 78 3d 31 30 0a 20 20 20 20 3e 3e 3e 20 67 20 3d 20 28 69 2a 69 20 66 6f 72 20 69 20 | >>>.x=10.....>>>.g.=.(i*i.for.i. |
0a40 | 69 6e 20 72 61 6e 67 65 28 78 29 29 0a 20 20 20 20 3e 3e 3e 20 78 20 3d 20 35 0a 20 20 20 20 3e | in.range(x)).....>>>.x.=.5.....> |
0a60 | 3e 3e 20 6c 69 73 74 28 67 29 0a 20 20 20 20 5b 30 2c 20 31 2c 20 34 2c 20 39 2c 20 31 36 2c 20 | >>.list(g).....[0,.1,.4,.9,.16,. |
0a80 | 32 35 2c 20 33 36 2c 20 34 39 2c 20 36 34 2c 20 38 31 5d 0a 0a 56 65 72 69 66 79 20 74 68 61 74 | 25,.36,.49,.64,.81]..Verify.that |
0aa0 | 20 74 68 65 20 6f 75 74 65 72 6d 6f 73 74 20 66 6f 72 2d 65 78 70 72 65 73 73 69 6f 6e 20 6d 61 | .the.outermost.for-expression.ma |
0ac0 | 6b 65 73 20 61 6e 20 69 6d 6d 65 64 69 61 74 65 20 63 68 65 63 6b 0a 66 6f 72 20 69 74 65 72 61 | kes.an.immediate.check.for.itera |
0ae0 | 62 69 6c 69 74 79 0a 0a 20 20 20 20 3e 3e 3e 20 28 69 20 66 6f 72 20 69 20 69 6e 20 36 29 0a 20 | bility......>>>.(i.for.i.in.6).. |
0b00 | 20 20 20 54 72 61 63 65 62 61 63 6b 20 28 6d 6f 73 74 20 72 65 63 65 6e 74 20 63 61 6c 6c 20 6c | ...Traceback.(most.recent.call.l |
0b20 | 61 73 74 29 3a 0a 20 20 20 20 20 20 46 69 6c 65 20 22 3c 70 79 73 68 65 6c 6c 23 34 3e 22 2c 20 | ast):.......File."<pyshell#4>",. |
0b40 | 6c 69 6e 65 20 31 2c 20 69 6e 20 2d 74 6f 70 6c 65 76 65 6c 2d 0a 20 20 20 20 20 20 20 20 28 69 | line.1,.in.-toplevel-.........(i |
0b60 | 20 66 6f 72 20 69 20 69 6e 20 36 29 0a 20 20 20 20 54 79 70 65 45 72 72 6f 72 3a 20 27 69 6e 74 | .for.i.in.6).....TypeError:.'int |
0b80 | 27 20 6f 62 6a 65 63 74 20 69 73 20 6e 6f 74 20 69 74 65 72 61 62 6c 65 0a 0a 56 65 72 69 66 79 | '.object.is.not.iterable..Verify |
0ba0 | 20 6c 61 74 65 20 62 69 6e 64 69 6e 67 20 66 6f 72 20 74 68 65 20 6f 75 74 65 72 6d 6f 73 74 20 | .late.binding.for.the.outermost. |
0bc0 | 69 66 2d 65 78 70 72 65 73 73 69 6f 6e 0a 0a 20 20 20 20 3e 3e 3e 20 69 6e 63 6c 75 64 65 20 3d | if-expression......>>>.include.= |
0be0 | 20 28 32 2c 34 2c 36 2c 38 29 0a 20 20 20 20 3e 3e 3e 20 67 20 3d 20 28 69 2a 69 20 66 6f 72 20 | .(2,4,6,8).....>>>.g.=.(i*i.for. |
0c00 | 69 20 69 6e 20 72 61 6e 67 65 28 31 30 29 20 69 66 20 69 20 69 6e 20 69 6e 63 6c 75 64 65 29 0a | i.in.range(10).if.i.in.include). |
0c20 | 20 20 20 20 3e 3e 3e 20 69 6e 63 6c 75 64 65 20 3d 20 28 31 2c 33 2c 35 2c 37 2c 39 29 0a 20 20 | ....>>>.include.=.(1,3,5,7,9)... |
0c40 | 20 20 3e 3e 3e 20 6c 69 73 74 28 67 29 0a 20 20 20 20 5b 31 2c 20 39 2c 20 32 35 2c 20 34 39 2c | ..>>>.list(g).....[1,.9,.25,.49, |
0c60 | 20 38 31 5d 0a 0a 56 65 72 69 66 79 20 6c 61 74 65 20 62 69 6e 64 69 6e 67 20 66 6f 72 20 74 68 | .81]..Verify.late.binding.for.th |
0c80 | 65 20 69 6e 6e 65 72 6d 6f 73 74 20 66 6f 72 2d 65 78 70 72 65 73 73 69 6f 6e 0a 0a 20 20 20 20 | e.innermost.for-expression...... |
0ca0 | 3e 3e 3e 20 67 20 3d 20 28 28 69 2c 6a 29 20 66 6f 72 20 69 20 69 6e 20 72 61 6e 67 65 28 33 29 | >>>.g.=.((i,j).for.i.in.range(3) |
0cc0 | 20 66 6f 72 20 6a 20 69 6e 20 72 61 6e 67 65 28 78 29 29 0a 20 20 20 20 3e 3e 3e 20 78 20 3d 20 | .for.j.in.range(x)).....>>>.x.=. |
0ce0 | 34 0a 20 20 20 20 3e 3e 3e 20 6c 69 73 74 28 67 29 0a 20 20 20 20 5b 28 30 2c 20 30 29 2c 20 28 | 4.....>>>.list(g).....[(0,.0),.( |
0d00 | 30 2c 20 31 29 2c 20 28 30 2c 20 32 29 2c 20 28 30 2c 20 33 29 2c 20 28 31 2c 20 30 29 2c 20 28 | 0,.1),.(0,.2),.(0,.3),.(1,.0),.( |
0d20 | 31 2c 20 31 29 2c 20 28 31 2c 20 32 29 2c 20 28 31 2c 20 33 29 2c 20 28 32 2c 20 30 29 2c 20 28 | 1,.1),.(1,.2),.(1,.3),.(2,.0),.( |
0d40 | 32 2c 20 31 29 2c 20 28 32 2c 20 32 29 2c 20 28 32 2c 20 33 29 5d 0a 0a 56 65 72 69 66 79 20 72 | 2,.1),.(2,.2),.(2,.3)]..Verify.r |
0d60 | 65 2d 75 73 65 20 6f 66 20 74 75 70 6c 65 73 20 28 61 20 73 69 64 65 20 62 65 6e 65 66 69 74 20 | e-use.of.tuples.(a.side.benefit. |
0d80 | 6f 66 20 75 73 69 6e 67 20 67 65 6e 65 78 70 73 20 6f 76 65 72 20 6c 69 73 74 63 6f 6d 70 73 29 | of.using.genexps.over.listcomps) |
0da0 | 0a 0a 20 20 20 20 3e 3e 3e 20 74 75 70 6c 65 69 64 73 20 3d 20 6d 61 70 28 69 64 2c 20 28 28 69 | ......>>>.tupleids.=.map(id,.((i |
0dc0 | 2c 69 29 20 66 6f 72 20 69 20 69 6e 20 78 72 61 6e 67 65 28 31 30 29 29 29 0a 20 20 20 20 3e 3e | ,i).for.i.in.xrange(10))).....>> |
0de0 | 3e 20 69 6e 74 28 6d 61 78 28 74 75 70 6c 65 69 64 73 29 20 2d 20 6d 69 6e 28 74 75 70 6c 65 69 | >.int(max(tupleids).-.min(tuplei |
0e00 | 64 73 29 29 0a 20 20 20 20 30 0a 0a 56 65 72 69 66 79 20 74 68 61 74 20 73 79 6e 74 61 78 20 65 | ds)).....0..Verify.that.syntax.e |
0e20 | 72 72 6f 72 27 73 20 61 72 65 20 72 61 69 73 65 64 20 66 6f 72 20 67 65 6e 65 78 70 73 20 75 73 | rror's.are.raised.for.genexps.us |
0e40 | 65 64 20 61 73 20 6c 76 61 6c 75 65 73 0a 0a 20 20 20 20 3e 3e 3e 20 28 79 20 66 6f 72 20 79 20 | ed.as.lvalues......>>>.(y.for.y. |
0e60 | 69 6e 20 28 31 2c 32 29 29 20 3d 20 31 30 0a 20 20 20 20 54 72 61 63 65 62 61 63 6b 20 28 6d 6f | in.(1,2)).=.10.....Traceback.(mo |
0e80 | 73 74 20 72 65 63 65 6e 74 20 63 61 6c 6c 20 6c 61 73 74 29 3a 0a 20 20 20 20 20 20 20 2e 2e 2e | st.recent.call.last):........... |
0ea0 | 0a 20 20 20 20 20 20 46 69 6c 65 20 22 3c 64 6f 63 74 65 73 74 20 74 65 73 74 2e 74 65 73 74 5f | .......File."<doctest.test.test_ |
0ec0 | 67 65 6e 65 78 70 73 2e 5f 5f 74 65 73 74 5f 5f 2e 64 6f 63 74 65 73 74 73 5b 34 30 5d 3e 22 2c | genexps.__test__.doctests[40]>", |
0ee0 | 20 6c 69 6e 65 20 31 0a 20 20 20 20 53 79 6e 74 61 78 45 72 72 6f 72 3a 20 63 61 6e 27 74 20 61 | .line.1.....SyntaxError:.can't.a |
0f00 | 73 73 69 67 6e 20 74 6f 20 67 65 6e 65 72 61 74 6f 72 20 65 78 70 72 65 73 73 69 6f 6e 0a 0a 20 | ssign.to.generator.expression... |
0f20 | 20 20 20 3e 3e 3e 20 28 79 20 66 6f 72 20 79 20 69 6e 20 28 31 2c 32 29 29 20 2b 3d 20 31 30 0a | ...>>>.(y.for.y.in.(1,2)).+=.10. |
0f40 | 20 20 20 20 54 72 61 63 65 62 61 63 6b 20 28 6d 6f 73 74 20 72 65 63 65 6e 74 20 63 61 6c 6c 20 | ....Traceback.(most.recent.call. |
0f60 | 6c 61 73 74 29 3a 0a 20 20 20 20 20 20 20 2e 2e 2e 0a 20 20 20 20 20 20 46 69 6c 65 20 22 3c 64 | last):..................File."<d |
0f80 | 6f 63 74 65 73 74 20 74 65 73 74 2e 74 65 73 74 5f 67 65 6e 65 78 70 73 2e 5f 5f 74 65 73 74 5f | octest.test.test_genexps.__test_ |
0fa0 | 5f 2e 64 6f 63 74 65 73 74 73 5b 34 31 5d 3e 22 2c 20 6c 69 6e 65 20 31 0a 20 20 20 20 53 79 6e | _.doctests[41]>",.line.1.....Syn |
0fc0 | 74 61 78 45 72 72 6f 72 3a 20 63 61 6e 27 74 20 61 73 73 69 67 6e 20 74 6f 20 67 65 6e 65 72 61 | taxError:.can't.assign.to.genera |
0fe0 | 74 6f 72 20 65 78 70 72 65 73 73 69 6f 6e 0a 0a 0a 23 23 23 23 23 23 23 23 23 23 23 20 54 65 73 | tor.expression...###########.Tes |
1000 | 74 73 20 62 6f 72 72 6f 77 65 64 20 66 72 6f 6d 20 6f 72 20 69 6e 73 70 69 72 65 64 20 62 79 20 | ts.borrowed.from.or.inspired.by. |
1020 | 74 65 73 74 5f 67 65 6e 65 72 61 74 6f 72 73 2e 70 79 20 23 23 23 23 23 23 23 23 23 23 23 23 0a | test_generators.py.############. |
1040 | 0a 4d 61 6b 65 20 61 20 67 65 6e 65 72 61 74 6f 72 20 74 68 61 74 20 61 63 74 73 20 6c 69 6b 65 | .Make.a.generator.that.acts.like |
1060 | 20 72 61 6e 67 65 28 29 0a 0a 20 20 20 20 3e 3e 3e 20 79 72 61 6e 67 65 20 3d 20 6c 61 6d 62 64 | .range()......>>>.yrange.=.lambd |
1080 | 61 20 6e 3a 20 20 28 69 20 66 6f 72 20 69 20 69 6e 20 78 72 61 6e 67 65 28 6e 29 29 0a 20 20 20 | a.n:..(i.for.i.in.xrange(n)).... |
10a0 | 20 3e 3e 3e 20 6c 69 73 74 28 79 72 61 6e 67 65 28 31 30 29 29 0a 20 20 20 20 5b 30 2c 20 31 2c | .>>>.list(yrange(10)).....[0,.1, |
10c0 | 20 32 2c 20 33 2c 20 34 2c 20 35 2c 20 36 2c 20 37 2c 20 38 2c 20 39 5d 0a 0a 47 65 6e 65 72 61 | .2,.3,.4,.5,.6,.7,.8,.9]..Genera |
10e0 | 74 6f 72 73 20 61 6c 77 61 79 73 20 72 65 74 75 72 6e 20 74 6f 20 74 68 65 20 6d 6f 73 74 20 72 | tors.always.return.to.the.most.r |
1100 | 65 63 65 6e 74 20 63 61 6c 6c 65 72 3a 0a 0a 20 20 20 20 3e 3e 3e 20 64 65 66 20 63 72 65 61 74 | ecent.caller:......>>>.def.creat |
1120 | 6f 72 28 29 3a 0a 20 20 20 20 2e 2e 2e 20 20 20 20 20 72 20 3d 20 79 72 61 6e 67 65 28 35 29 0a | or():.............r.=.yrange(5). |
1140 | 20 20 20 20 2e 2e 2e 20 20 20 20 20 70 72 69 6e 74 20 22 63 72 65 61 74 6f 72 22 2c 20 72 2e 6e | ............print."creator",.r.n |
1160 | 65 78 74 28 29 0a 20 20 20 20 2e 2e 2e 20 20 20 20 20 72 65 74 75 72 6e 20 72 0a 20 20 20 20 3e | ext().............return.r.....> |
1180 | 3e 3e 20 64 65 66 20 63 61 6c 6c 65 72 28 29 3a 0a 20 20 20 20 2e 2e 2e 20 20 20 20 20 72 20 3d | >>.def.caller():.............r.= |
11a0 | 20 63 72 65 61 74 6f 72 28 29 0a 20 20 20 20 2e 2e 2e 20 20 20 20 20 66 6f 72 20 69 20 69 6e 20 | .creator().............for.i.in. |
11c0 | 72 3a 0a 20 20 20 20 2e 2e 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 6e 74 20 22 63 61 | r:.....................print."ca |
11e0 | 6c 6c 65 72 22 2c 20 69 0a 20 20 20 20 3e 3e 3e 20 63 61 6c 6c 65 72 28 29 0a 20 20 20 20 63 72 | ller",.i.....>>>.caller().....cr |
1200 | 65 61 74 6f 72 20 30 0a 20 20 20 20 63 61 6c 6c 65 72 20 31 0a 20 20 20 20 63 61 6c 6c 65 72 20 | eator.0.....caller.1.....caller. |
1220 | 32 0a 20 20 20 20 63 61 6c 6c 65 72 20 33 0a 20 20 20 20 63 61 6c 6c 65 72 20 34 0a 0a 47 65 6e | 2.....caller.3.....caller.4..Gen |
1240 | 65 72 61 74 6f 72 73 20 63 61 6e 20 63 61 6c 6c 20 6f 74 68 65 72 20 67 65 6e 65 72 61 74 6f 72 | erators.can.call.other.generator |
1260 | 73 3a 0a 0a 20 20 20 20 3e 3e 3e 20 64 65 66 20 7a 72 61 6e 67 65 28 6e 29 3a 0a 20 20 20 20 2e | s:......>>>.def.zrange(n):...... |
1280 | 2e 2e 20 20 20 20 20 66 6f 72 20 69 20 69 6e 20 79 72 61 6e 67 65 28 6e 29 3a 0a 20 20 20 20 2e | .......for.i.in.yrange(n):...... |
12a0 | 2e 2e 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 69 0a 20 20 20 20 3e 3e 3e 20 6c 69 73 74 28 | ...........yield.i.....>>>.list( |
12c0 | 7a 72 61 6e 67 65 28 35 29 29 0a 20 20 20 20 5b 30 2c 20 31 2c 20 32 2c 20 33 2c 20 34 5d 0a 0a | zrange(5)).....[0,.1,.2,.3,.4].. |
12e0 | 0a 56 65 72 69 66 79 20 74 68 61 74 20 61 20 67 65 6e 20 65 78 70 20 63 61 6e 6e 6f 74 20 62 65 | .Verify.that.a.gen.exp.cannot.be |
1300 | 20 72 65 73 75 6d 65 64 20 77 68 69 6c 65 20 69 74 20 69 73 20 61 63 74 69 76 65 6c 79 20 72 75 | .resumed.while.it.is.actively.ru |
1320 | 6e 6e 69 6e 67 3a 0a 0a 20 20 20 20 3e 3e 3e 20 67 20 3d 20 28 6d 65 2e 6e 65 78 74 28 29 20 66 | nning:......>>>.g.=.(me.next().f |
1340 | 6f 72 20 69 20 69 6e 20 78 72 61 6e 67 65 28 31 30 29 29 0a 20 20 20 20 3e 3e 3e 20 6d 65 20 3d | or.i.in.xrange(10)).....>>>.me.= |
1360 | 20 67 0a 20 20 20 20 3e 3e 3e 20 6d 65 2e 6e 65 78 74 28 29 0a 20 20 20 20 54 72 61 63 65 62 61 | .g.....>>>.me.next().....Traceba |
1380 | 63 6b 20 28 6d 6f 73 74 20 72 65 63 65 6e 74 20 63 61 6c 6c 20 6c 61 73 74 29 3a 0a 20 20 20 20 | ck.(most.recent.call.last):..... |
13a0 | 20 20 46 69 6c 65 20 22 3c 70 79 73 68 65 6c 6c 23 33 30 3e 22 2c 20 6c 69 6e 65 20 31 2c 20 69 | ..File."<pyshell#30>",.line.1,.i |
13c0 | 6e 20 2d 74 6f 70 6c 65 76 65 6c 2d 0a 20 20 20 20 20 20 20 20 6d 65 2e 6e 65 78 74 28 29 0a 20 | n.-toplevel-.........me.next().. |
13e0 | 20 20 20 20 20 46 69 6c 65 20 22 3c 70 79 73 68 65 6c 6c 23 32 38 3e 22 2c 20 6c 69 6e 65 20 31 | .....File."<pyshell#28>",.line.1 |
1400 | 2c 20 69 6e 20 3c 67 65 6e 65 72 61 74 6f 72 20 65 78 70 72 65 73 73 69 6f 6e 3e 0a 20 20 20 20 | ,.in.<generator.expression>..... |
1420 | 20 20 20 20 67 20 3d 20 28 6d 65 2e 6e 65 78 74 28 29 20 66 6f 72 20 69 20 69 6e 20 78 72 61 6e | ....g.=.(me.next().for.i.in.xran |
1440 | 67 65 28 31 30 29 29 0a 20 20 20 20 56 61 6c 75 65 45 72 72 6f 72 3a 20 67 65 6e 65 72 61 74 6f | ge(10)).....ValueError:.generato |
1460 | 72 20 61 6c 72 65 61 64 79 20 65 78 65 63 75 74 69 6e 67 0a 0a 56 65 72 69 66 79 20 65 78 63 65 | r.already.executing..Verify.exce |
1480 | 70 74 69 6f 6e 20 70 72 6f 70 61 67 61 74 69 6f 6e 0a 0a 20 20 20 20 3e 3e 3e 20 67 20 3d 20 28 | ption.propagation......>>>.g.=.( |
14a0 | 31 30 20 2f 2f 20 69 20 66 6f 72 20 69 20 69 6e 20 28 35 2c 20 30 2c 20 32 29 29 0a 20 20 20 20 | 10.//.i.for.i.in.(5,.0,.2))..... |
14c0 | 3e 3e 3e 20 67 2e 6e 65 78 74 28 29 0a 20 20 20 20 32 0a 20 20 20 20 3e 3e 3e 20 67 2e 6e 65 78 | >>>.g.next().....2.....>>>.g.nex |
14e0 | 74 28 29 0a 20 20 20 20 54 72 61 63 65 62 61 63 6b 20 28 6d 6f 73 74 20 72 65 63 65 6e 74 20 63 | t().....Traceback.(most.recent.c |
1500 | 61 6c 6c 20 6c 61 73 74 29 3a 0a 20 20 20 20 20 20 46 69 6c 65 20 22 3c 70 79 73 68 65 6c 6c 23 | all.last):.......File."<pyshell# |
1520 | 33 37 3e 22 2c 20 6c 69 6e 65 20 31 2c 20 69 6e 20 2d 74 6f 70 6c 65 76 65 6c 2d 0a 20 20 20 20 | 37>",.line.1,.in.-toplevel-..... |
1540 | 20 20 20 20 67 2e 6e 65 78 74 28 29 0a 20 20 20 20 20 20 46 69 6c 65 20 22 3c 70 79 73 68 65 6c | ....g.next().......File."<pyshel |
1560 | 6c 23 33 35 3e 22 2c 20 6c 69 6e 65 20 31 2c 20 69 6e 20 3c 67 65 6e 65 72 61 74 6f 72 20 65 78 | l#35>",.line.1,.in.<generator.ex |
1580 | 70 72 65 73 73 69 6f 6e 3e 0a 20 20 20 20 20 20 20 20 67 20 3d 20 28 31 30 20 2f 2f 20 69 20 66 | pression>.........g.=.(10.//.i.f |
15a0 | 6f 72 20 69 20 69 6e 20 28 35 2c 20 30 2c 20 32 29 29 0a 20 20 20 20 5a 65 72 6f 44 69 76 69 73 | or.i.in.(5,.0,.2)).....ZeroDivis |
15c0 | 69 6f 6e 45 72 72 6f 72 3a 20 69 6e 74 65 67 65 72 20 64 69 76 69 73 69 6f 6e 20 6f 72 20 6d 6f | ionError:.integer.division.or.mo |
15e0 | 64 75 6c 6f 20 62 79 20 7a 65 72 6f 0a 20 20 20 20 3e 3e 3e 20 67 2e 6e 65 78 74 28 29 0a 20 20 | dulo.by.zero.....>>>.g.next()... |
1600 | 20 20 54 72 61 63 65 62 61 63 6b 20 28 6d 6f 73 74 20 72 65 63 65 6e 74 20 63 61 6c 6c 20 6c 61 | ..Traceback.(most.recent.call.la |
1620 | 73 74 29 3a 0a 20 20 20 20 20 20 46 69 6c 65 20 22 3c 70 79 73 68 65 6c 6c 23 33 38 3e 22 2c 20 | st):.......File."<pyshell#38>",. |
1640 | 6c 69 6e 65 20 31 2c 20 69 6e 20 2d 74 6f 70 6c 65 76 65 6c 2d 0a 20 20 20 20 20 20 20 20 67 2e | line.1,.in.-toplevel-.........g. |
1660 | 6e 65 78 74 28 29 0a 20 20 20 20 53 74 6f 70 49 74 65 72 61 74 69 6f 6e 0a 0a 4d 61 6b 65 20 73 | next().....StopIteration..Make.s |
1680 | 75 72 65 20 74 68 61 74 20 4e 6f 6e 65 20 69 73 20 61 20 76 61 6c 69 64 20 72 65 74 75 72 6e 20 | ure.that.None.is.a.valid.return. |
16a0 | 76 61 6c 75 65 0a 0a 20 20 20 20 3e 3e 3e 20 6c 69 73 74 28 4e 6f 6e 65 20 66 6f 72 20 69 20 69 | value......>>>.list(None.for.i.i |
16c0 | 6e 20 78 72 61 6e 67 65 28 31 30 29 29 0a 20 20 20 20 5b 4e 6f 6e 65 2c 20 4e 6f 6e 65 2c 20 4e | n.xrange(10)).....[None,.None,.N |
16e0 | 6f 6e 65 2c 20 4e 6f 6e 65 2c 20 4e 6f 6e 65 2c 20 4e 6f 6e 65 2c 20 4e 6f 6e 65 2c 20 4e 6f 6e | one,.None,.None,.None,.None,.Non |
1700 | 65 2c 20 4e 6f 6e 65 2c 20 4e 6f 6e 65 5d 0a 0a 43 68 65 63 6b 20 74 68 61 74 20 67 65 6e 65 72 | e,.None,.None]..Check.that.gener |
1720 | 61 74 6f 72 20 61 74 74 72 69 62 75 74 65 73 20 61 72 65 20 70 72 65 73 65 6e 74 0a 0a 20 20 20 | ator.attributes.are.present..... |
1740 | 20 3e 3e 3e 20 67 20 3d 20 28 69 2a 69 20 66 6f 72 20 69 20 69 6e 20 72 61 6e 67 65 28 33 29 29 | .>>>.g.=.(i*i.for.i.in.range(3)) |
1760 | 0a 20 20 20 20 3e 3e 3e 20 65 78 70 65 63 74 65 64 20 3d 20 73 65 74 28 5b 27 67 69 5f 66 72 61 | .....>>>.expected.=.set(['gi_fra |
1780 | 6d 65 27 2c 20 27 67 69 5f 72 75 6e 6e 69 6e 67 27 2c 20 27 6e 65 78 74 27 5d 29 0a 20 20 20 20 | me',.'gi_running',.'next'])..... |
17a0 | 3e 3e 3e 20 73 65 74 28 61 74 74 72 20 66 6f 72 20 61 74 74 72 20 69 6e 20 64 69 72 28 67 29 20 | >>>.set(attr.for.attr.in.dir(g). |
17c0 | 69 66 20 6e 6f 74 20 61 74 74 72 2e 73 74 61 72 74 73 77 69 74 68 28 27 5f 5f 27 29 29 20 3e 3d | if.not.attr.startswith('__')).>= |
17e0 | 20 65 78 70 65 63 74 65 64 0a 20 20 20 20 54 72 75 65 0a 0a 20 20 20 20 3e 3e 3e 20 66 72 6f 6d | .expected.....True......>>>.from |
1800 | 20 74 65 73 74 2e 74 65 73 74 5f 73 75 70 70 6f 72 74 20 69 6d 70 6f 72 74 20 48 41 56 45 5f 44 | .test.test_support.import.HAVE_D |
1820 | 4f 43 53 54 52 49 4e 47 53 0a 20 20 20 20 3e 3e 3e 20 70 72 69 6e 74 28 67 2e 6e 65 78 74 2e 5f | OCSTRINGS.....>>>.print(g.next._ |
1840 | 5f 64 6f 63 5f 5f 20 69 66 20 48 41 56 45 5f 44 4f 43 53 54 52 49 4e 47 53 20 65 6c 73 65 20 27 | _doc__.if.HAVE_DOCSTRINGS.else.' |
1860 | 78 2e 6e 65 78 74 28 29 20 2d 3e 20 74 68 65 20 6e 65 78 74 20 76 61 6c 75 65 2c 20 6f 72 20 72 | x.next().->.the.next.value,.or.r |
1880 | 61 69 73 65 20 53 74 6f 70 49 74 65 72 61 74 69 6f 6e 27 29 0a 20 20 20 20 78 2e 6e 65 78 74 28 | aise.StopIteration').....x.next( |
18a0 | 29 20 2d 3e 20 74 68 65 20 6e 65 78 74 20 76 61 6c 75 65 2c 20 6f 72 20 72 61 69 73 65 20 53 74 | ).->.the.next.value,.or.raise.St |
18c0 | 6f 70 49 74 65 72 61 74 69 6f 6e 0a 20 20 20 20 3e 3e 3e 20 69 6d 70 6f 72 74 20 74 79 70 65 73 | opIteration.....>>>.import.types |
18e0 | 0a 20 20 20 20 3e 3e 3e 20 69 73 69 6e 73 74 61 6e 63 65 28 67 2c 20 74 79 70 65 73 2e 47 65 6e | .....>>>.isinstance(g,.types.Gen |
1900 | 65 72 61 74 6f 72 54 79 70 65 29 0a 20 20 20 20 54 72 75 65 0a 0a 43 68 65 63 6b 20 74 68 65 20 | eratorType).....True..Check.the. |
1920 | 5f 5f 69 74 65 72 5f 5f 20 73 6c 6f 74 20 69 73 20 64 65 66 69 6e 65 64 20 74 6f 20 72 65 74 75 | __iter__.slot.is.defined.to.retu |
1940 | 72 6e 20 73 65 6c 66 0a 0a 20 20 20 20 3e 3e 3e 20 69 74 65 72 28 67 29 20 69 73 20 67 0a 20 20 | rn.self......>>>.iter(g).is.g... |
1960 | 20 20 54 72 75 65 0a 0a 56 65 72 69 66 79 20 74 68 61 74 20 74 68 65 20 72 75 6e 6e 69 6e 67 20 | ..True..Verify.that.the.running. |
1980 | 66 6c 61 67 20 69 73 20 73 65 74 20 70 72 6f 70 65 72 6c 79 0a 0a 20 20 20 20 3e 3e 3e 20 67 20 | flag.is.set.properly......>>>.g. |
19a0 | 3d 20 28 6d 65 2e 67 69 5f 72 75 6e 6e 69 6e 67 20 66 6f 72 20 69 20 69 6e 20 28 30 2c 31 29 29 | =.(me.gi_running.for.i.in.(0,1)) |
19c0 | 0a 20 20 20 20 3e 3e 3e 20 6d 65 20 3d 20 67 0a 20 20 20 20 3e 3e 3e 20 6d 65 2e 67 69 5f 72 75 | .....>>>.me.=.g.....>>>.me.gi_ru |
19e0 | 6e 6e 69 6e 67 0a 20 20 20 20 30 0a 20 20 20 20 3e 3e 3e 20 6d 65 2e 6e 65 78 74 28 29 0a 20 20 | nning.....0.....>>>.me.next()... |
1a00 | 20 20 31 0a 20 20 20 20 3e 3e 3e 20 6d 65 2e 67 69 5f 72 75 6e 6e 69 6e 67 0a 20 20 20 20 30 0a | ..1.....>>>.me.gi_running.....0. |
1a20 | 0a 56 65 72 69 66 79 20 74 68 61 74 20 67 65 6e 65 78 70 73 20 61 72 65 20 77 65 61 6b 6c 79 20 | .Verify.that.genexps.are.weakly. |
1a40 | 72 65 66 65 72 65 6e 63 61 62 6c 65 0a 0a 20 20 20 20 3e 3e 3e 20 69 6d 70 6f 72 74 20 77 65 61 | referencable......>>>.import.wea |
1a60 | 6b 72 65 66 0a 20 20 20 20 3e 3e 3e 20 67 20 3d 20 28 69 2a 69 20 66 6f 72 20 69 20 69 6e 20 72 | kref.....>>>.g.=.(i*i.for.i.in.r |
1a80 | 61 6e 67 65 28 34 29 29 0a 20 20 20 20 3e 3e 3e 20 77 72 20 3d 20 77 65 61 6b 72 65 66 2e 72 65 | ange(4)).....>>>.wr.=.weakref.re |
1aa0 | 66 28 67 29 0a 20 20 20 20 3e 3e 3e 20 77 72 28 29 20 69 73 20 67 0a 20 20 20 20 54 72 75 65 0a | f(g).....>>>.wr().is.g.....True. |
1ac0 | 20 20 20 20 3e 3e 3e 20 70 20 3d 20 77 65 61 6b 72 65 66 2e 70 72 6f 78 79 28 67 29 0a 20 20 20 | ....>>>.p.=.weakref.proxy(g).... |
1ae0 | 20 3e 3e 3e 20 6c 69 73 74 28 70 29 0a 20 20 20 20 5b 30 2c 20 31 2c 20 34 2c 20 39 5d 0a 0a 0a | .>>>.list(p).....[0,.1,.4,.9]... |
1b00 | 74 08 00 00 00 64 6f 63 74 65 73 74 73 63 01 00 00 00 07 00 00 00 05 00 00 00 43 00 00 00 73 bd | t....doctestsc............C...s. |
1b20 | 00 00 00 64 01 00 64 00 00 6c 00 00 7d 01 00 64 01 00 64 02 00 6c 01 00 6d 02 00 7d 02 00 01 64 | ...d..d..l..}..d..d..l..m..}...d |
1b40 | 01 00 64 03 00 6c 01 00 6d 03 00 7d 03 00 01 7c 02 00 6a 04 00 7c 03 00 7c 00 00 83 02 00 01 7c | ..d..l..m..}...|..j..|..|......| |
1b60 | 00 00 72 b9 00 74 05 00 7c 01 00 64 04 00 83 02 00 72 b9 00 64 01 00 64 00 00 6c 06 00 7d 04 00 | ..r..t..|..d.....r..d..d..l..}.. |
1b80 | 64 00 00 67 01 00 64 05 00 14 7d 05 00 78 44 00 74 08 00 74 09 00 7c 05 00 83 01 00 83 01 00 44 | d..g..d...}..xD.t..t..|........D |
1ba0 | 5d 30 00 7d 06 00 7c 02 00 6a 04 00 7c 03 00 7c 00 00 83 02 00 01 7c 04 00 6a 0a 00 83 00 00 01 | ]0.}..|..j..|..|......|..j...... |
1bc0 | 7c 01 00 6a 0b 00 83 00 00 7c 05 00 7c 06 00 3c 71 7d 00 57 7c 05 00 47 48 6e 00 00 64 00 00 53 | |..j.....|..|..<q}.W|..GHn..d..S |
1be0 | 28 06 00 00 00 4e 69 ff ff ff ff 28 01 00 00 00 74 0c 00 00 00 74 65 73 74 5f 73 75 70 70 6f 72 | (....Ni....(....t....test_suppor |
1c00 | 74 28 01 00 00 00 74 0c 00 00 00 74 65 73 74 5f 67 65 6e 65 78 70 73 74 10 00 00 00 67 65 74 74 | t(....t....test_genexpst....gett |
1c20 | 6f 74 61 6c 72 65 66 63 6f 75 6e 74 69 05 00 00 00 28 0c 00 00 00 74 03 00 00 00 73 79 73 74 04 | otalrefcounti....(....t....syst. |
1c40 | 00 00 00 74 65 73 74 52 01 00 00 00 52 02 00 00 00 74 0b 00 00 00 72 75 6e 5f 64 6f 63 74 65 73 | ...testR....R....t....run_doctes |
1c60 | 74 74 07 00 00 00 68 61 73 61 74 74 72 74 02 00 00 00 67 63 74 04 00 00 00 4e 6f 6e 65 74 06 00 | tt....hasattrt....gct....Nonet.. |
1c80 | 00 00 78 72 61 6e 67 65 74 03 00 00 00 6c 65 6e 74 07 00 00 00 63 6f 6c 6c 65 63 74 52 03 00 00 | ..xranget....lent....collectR... |
1ca0 | 00 28 07 00 00 00 74 07 00 00 00 76 65 72 62 6f 73 65 52 04 00 00 00 52 01 00 00 00 52 02 00 00 | .(....t....verboseR....R....R... |
1cc0 | 00 52 08 00 00 00 74 06 00 00 00 63 6f 75 6e 74 73 74 01 00 00 00 69 28 00 00 00 00 28 00 00 00 | .R....t....countst....i(....(... |
1ce0 | 00 73 59 00 00 00 2f 74 6d 70 2f 6e 64 6b 2d 55 73 65 72 2f 62 75 69 6c 64 68 6f 73 74 2f 69 6e | .sY.../tmp/ndk-User/buildhost/in |
1d00 | 73 74 61 6c 6c 2f 70 72 65 62 75 69 6c 74 2f 64 61 72 77 69 6e 2d 78 38 36 5f 36 34 2f 6c 69 62 | stall/prebuilt/darwin-x86_64/lib |
1d20 | 2f 70 79 74 68 6f 6e 32 2e 37 2f 74 65 73 74 2f 74 65 73 74 5f 67 65 6e 65 78 70 73 2e 70 79 74 | /python2.7/test/test_genexps.pyt |
1d40 | 09 00 00 00 74 65 73 74 5f 6d 61 69 6e 0a 01 00 00 73 18 00 00 00 00 01 0c 01 10 01 10 01 10 03 | ....test_main....s.............. |
1d60 | 15 01 0c 01 0d 01 19 01 10 01 0a 01 14 01 74 08 00 00 00 5f 5f 6d 61 69 6e 5f 5f 52 0d 00 00 00 | ..............t....__main__R.... |
1d80 | 4e 28 06 00 00 00 52 00 00 00 00 74 08 00 00 00 5f 5f 74 65 73 74 5f 5f 52 09 00 00 00 52 10 00 | N(....R....t....__test__R....R.. |
1da0 | 00 00 74 08 00 00 00 5f 5f 6e 61 6d 65 5f 5f 74 04 00 00 00 54 72 75 65 28 00 00 00 00 28 00 00 | ..t....__name__t....True(....(.. |
1dc0 | 00 00 28 00 00 00 00 73 59 00 00 00 2f 74 6d 70 2f 6e 64 6b 2d 55 73 65 72 2f 62 75 69 6c 64 68 | ..(....sY.../tmp/ndk-User/buildh |
1de0 | 6f 73 74 2f 69 6e 73 74 61 6c 6c 2f 70 72 65 62 75 69 6c 74 2f 64 61 72 77 69 6e 2d 78 38 36 5f | ost/install/prebuilt/darwin-x86_ |
1e00 | 36 34 2f 6c 69 62 2f 70 79 74 68 6f 6e 32 2e 37 2f 74 65 73 74 2f 74 65 73 74 5f 67 65 6e 65 78 | 64/lib/python2.7/test/test_genex |
1e20 | 70 73 2e 70 79 74 08 00 00 00 3c 6d 6f 64 75 6c 65 3e 05 01 00 00 73 08 00 00 00 06 03 0d 02 0c | ps.pyt....<module>....s......... |
1e40 | 10 0c 01 | ... |