function pointer

David Brown david at no.westcontrol.spam.com
Wed Sep 11 06:26:44 EDT 2002


"Christina" <christina at iaeste.at> wrote in message
news:ffcedbc9.0209110215.644c1788 at posting.google.com...
> Hi!
>
> Does Python have function pointers? If not, is there a possibility to
emulate them?
>
> Christina

Functions are first-order objects (is that the right term?) in Python, so
you can just assign them to a variable.  For example:

def foo(x):
    print x

bar = foo

bar(10)







More information about the Python-list mailing list