having both dynamic and static variables

Santoso Wijaya santoso.wijaya at gmail.com
Sat Mar 5 23:03:14 EST 2011


A function object can get bound to a name, too:

def foo(x):
    return x + 1

foo = lambda x: x - 1
assert foo(1) == 0

~/santa


On Sat, Mar 5, 2011 at 7:46 PM, Corey Richardson <kb1pkl at aim.com> wrote:

> On 03/05/2011 10:23 PM, MRAB wrote:
> > Having a fixed binding could be useful elsewhere, for example, with
> > function definitions:
> > [..]
> >      fixed PI = 3.1415926535897932384626433832795028841971693993751
> >
> >      fixed def squared(x):
> >          return x * x
>
> This question spawns from my ignorance: When would a functions
> definition change? What is the difference between a dynamic function and
> a fixed function?
>
> --
> Corey Richardson
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110305/e310f662/attachment-0001.html>


More information about the Python-list mailing list