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/2003-February/033333.html below:

[Python-Dev] lazy evaluation redux

[Python-Dev] lazy evaluation redux [Python-Dev] lazy evaluation reduxGuido van Rossum guido@python.org
Tue, 11 Feb 2003 10:35:32 -0500
Sorry, this thread doesn't belong on python-dev.  If you really need
lazy evaluation, you can do it without changes to the langage.  Just
enclose lazy arguments in quotes.  Then you can use something like
this:

import sys

def lazy(s):
    f = sys._getframe(1)
    return eval(s, f.f_globals, f.f_locals)

def foo():
    a = 12
    b = 42
    print lazy("a+b")

foo()

--Guido van Rossum (home page: http://www.python.org/~guido/)



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