mirror of
https://github.com/python/cpython.git
synced 2025-10-18 04:38:07 +00:00
Add more complete reference. Change a co.back() call to co.tran() --
that's all that's needed.
This commit is contained in:
parent
5ddd1a8dcb
commit
27f9b84684
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
# Coroutine example: general coroutine transfers
|
# Coroutine example: general coroutine transfers
|
||||||
#
|
#
|
||||||
# The program is a variation of a Simula 67 program due to Dahl & Hoare,
|
# The program is a variation of a Simula 67 program due to Dahl & Hoare,
|
||||||
|
# (Dahl/Dijkstra/Hoare, Structured Programming; Academic Press, 1972)
|
||||||
# who in turn credit the original example to Conway.
|
# who in turn credit the original example to Conway.
|
||||||
#
|
#
|
||||||
# We have a number of input lines, terminated by a 0 byte. The problem
|
# We have a number of input lines, terminated by a 0 byte. The problem
|
||||||
|
@ -43,7 +44,7 @@ from Coroutine import *
|
||||||
|
|
||||||
def getline(text):
|
def getline(text):
|
||||||
for line in string.splitfields(text, '\n'):
|
for line in string.splitfields(text, '\n'):
|
||||||
co.back(line)
|
co.tran(codisassembler, line)
|
||||||
|
|
||||||
def disassembler():
|
def disassembler():
|
||||||
while 1:
|
while 1:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue