[Python-ideas] Delay evaluation of annotations

אלעזר elazarg at gmail.com
Thu Sep 22 17:33:58 EDT 2016


On Fri, Sep 23, 2016 at 12:18 AM Chris Angelico <rosuav at gmail.com> wrote:

> # Recursion in functions
> def spam():
>     return spam()
>

I just note that it *is* surprising, for most users, that you can't be sure
that this is a recursion, yet. So it if you want a trusted-upon recursion
you should write

# spam:
def spam():
    def spam():
        return spam()
    return spam()


Elazar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160922/c523fcfc/attachment.html>


More information about the Python-ideas mailing list