A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/337396.html below:

Replacement for lambda - 'def' as an expression?

Replacement for lambda - 'def' as an expression? Replacement for lambda - 'def' as an expression?Sybren Stuvel sybrenUSE at YOURthirdtower.com.imagination
Tue Sep 6 12:06:54 EDT 2005
Leif K-Brooks enlightened us with:
>> It also allows for dynamic function creation in cases where a name
>> would not be available.
>
> What cases are those?

An example:

def generate_randomizer(n, m):
    randomizer = def(x):
        return x ** n % m

    return randomizer

Sybren
-- 
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself? 
                                             Frank Zappa

More information about the Python-list 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