function pointers

Courageous jkraska1 at san.rr.com
Thu Apr 26 11:21:05 EDT 2001


>I get the feeling that Python doesn't have anything resembling a function
>pointer?

Not only does it have function pointer equivalents, it does things that even
C, C++, and Java can't. For example:

>>> class MyClass:
	def f(self):
		print "amazing"

		
>>> m = MyClass()
>>> f = m.f
>>> f()
amazing
>>> 

You can't do that in C++ or Java!

It's very cool.

C//





More information about the Python-list mailing list