|
484 | 484 | A->A B->G C->A D->G E->G F->A G->G H->G I->A J->G K->A L->A M->G |
485 | 485 | merged A into G |
486 | 486 | A->G B->G C->G D->G E->G F->G G->G H->G I->G J->G K->G L->G M->G |
487 | | ->>> for s in sets: # XXX memory leak without this |
488 | | -... s.clear() |
489 | 487 | """ |
490 | 488 |
|
491 | 489 | # Fun tests (for sufficiently warped notions of "fun"). |
|
614 | 612 | ... yield i |
615 | 613 |
|
616 | 614 | Print as many of these as you like -- *this* implementation is memory- |
617 | | -efficient. XXX Except that it leaks unless you clear the dict! |
| 615 | +efficient. |
618 | 616 |
|
619 | 617 | >>> m235 = LazyList(m235()) |
620 | 618 | >>> for i in range(5): |
|
625 | 623 | [200, 216, 225, 240, 243, 250, 256, 270, 288, 300, 320, 324, 360, 375, 384] |
626 | 624 | [400, 405, 432, 450, 480, 486, 500, 512, 540, 576, 600, 625, 640, 648, 675] |
627 | 625 |
|
628 | | ->>> m235.clear() # XXX memory leak without this |
629 | | -
|
630 | 626 |
|
631 | 627 | Ye olde Fibonacci generator, LazyList style. |
632 | 628 |
|
|
650 | 646 | >>> fib = LazyList(fibgen(1, 2)) |
651 | 647 | >>> firstn(iter(fib), 17) |
652 | 648 | [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584] |
653 | | -
|
654 | | ->>> fib.clear() # XXX memory leak without this |
655 | 649 | """ |
656 | 650 |
|
657 | 651 | # syntax_tests mostly provokes SyntaxErrors. Also fiddling with #if 0 |
|
0 commit comments