dynamic invoke

Diez B. Roggisch deets at nospam.web.de
Fri Oct 19 17:05:28 CEST 2007

Sushant wrote:

> Python will not allow string to be used a function pointer. It is type
> unsafe. Best way is to convert string into function pointers manually.
> if dynamicMethod == 'bar':
>     method = oFoo->bar
> else:
>     method = oFoo->default
> method()

Sorry to say so, but that answer is bogus. It's not even Python!

Jarek has already shown how to solve this problem. And type-safety-issues
have nothing to do with it at all. 


More information about the Python-list mailing list