A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-April/053140.html below:

[Python-Dev] PEP 340: What is "ret" in block statement semantics?

[Python-Dev] PEP 340: What is "ret" in block statement semantics? [Python-Dev] PEP 340: What is "ret" in block statement semantics?Skip Montanaro skip at pobox.com
Fri Apr 29 16:48:24 CEST 2005
PEP 340 describes the block statement translation as:

        itr = EXPR1
        val = arg = None
        ret = False
        while True:
            try:
                VAR1 = next(itr, arg)
            except StopIteration:
                if ret:
                    return val
                if val is not None:
                    raise val
                break
            try:
                val = arg = None
                ret = False
                BLOCK1
            except Exception, val:
                arg = StopIteration()

It uses a variable "ret" that is always False.  If it does manage to take on
a True value, a return statement is executed.  How does ret become True?
What's meaning of return in this context?  Something seems amiss.

Skip
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4