update from Atlas repo

This commit is contained in:
Luciano Ramalho
2014-12-21 09:01:11 -02:00
parent 33d65dc590
commit 9db73c75ef
6 changed files with 159 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
""" Example from `Python: The Full Monty`__ -- A Tested Semantics for the
Python Programming Language
__ http://cs.brown.edu/~sk/Publications/Papers/Published/pmmwplck-python-full-monty/
"The following program, [...] seems to perform a simple abstraction over the
process of yielding:"
Citation:
Joe Gibbs Politz, Alejandro Martinez, Matthew Milano, Sumner Warren,
Daniel Patterson, Junsong Li, Anand Chitipothu, and Shriram Krishnamurthi.
2013. Python: the full monty. SIGPLAN Not. 48, 10 (October 2013), 217-232.
DOI=10.1145/2544173.2509536 http://doi.acm.org/10.1145/2544173.2509536
"""
# BEGIN YIELD_DELEGATE_FAIL
def f():
def do_yield(n):
yield n
x = 0
while True:
x += 1
do_yield(x)
# END YIELD_DELEGATE_FAIL
if __name__ == '__main__':
print('Invoking f() results in an infinite loop')
f()