Python中实现goto功能
分类:Python
A function decorator to use goto
in Python. Tested on Python 2.6 through 3.7 and PyPy.
Installation
pip install goto-statement
Usage
from goto import with_goto
@with_goto
def range(start, stop):
i = start
result = []
label .begin
if i == stop:
goto .end
result.append(i)
i += 1
goto .begin
label .end
return result
from https://github.com/snoack/python-goto