gerhard.haering at opus-gmbh.net
Wed Sep 11 06:46:44 EDT 2002
David Brown wrote:
> "Christina" <christina at iaeste.at> wrote in message
> news:ffcedbc9.0209110215.644c1788 at posting.google.com...
>> Does Python have function pointers? If not, is there a possibility to
> emulate them?
Broken quoting - yuck! Your newsreader is broken. Please repair it (using
third party software) or make Usenet a better place by throwing away that
> Functions are first-order objects (is that the right term?)
> in Python, so you can just assign them to a variable.
If we want to keep the terminology right, Python doesn't have variables. It
has names and values. Values are bound to names. In your case:
> def foo(x):
> print x
... you create a function object using the def statement and bind it to the
> bar = foo
Here you bind the name 'bar' to the value the name 'foo' refers to.
More information about the Python-list