mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Whitespace normalization (via reindent.py).
This commit is contained in:
parent
e8889c5741
commit
9e34c04732
10 changed files with 19 additions and 23 deletions
|
@ -709,18 +709,18 @@ are quite straightforwardly expressed with this Python idiom.
|
|||
Ye olde Fibonacci generator, tee style.
|
||||
|
||||
>>> def fib():
|
||||
...
|
||||
...
|
||||
... def _isum(g, h):
|
||||
... while 1:
|
||||
... yield g.next() + h.next()
|
||||
...
|
||||
...
|
||||
... def _fib():
|
||||
... yield 1
|
||||
... yield 2
|
||||
... fibTail.next() # throw first away
|
||||
... for res in _isum(fibHead, fibTail):
|
||||
... yield res
|
||||
...
|
||||
...
|
||||
... fibHead, fibTail, fibRes = tee(_fib(), 3)
|
||||
... return fibRes
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue