absolute namespace for callbacks?

Warren Postma embed at geocities.com
Tue Mar 6 18:52:09 CET 2001


"Bruce Edge" <bedge at troikanetworks.com> wrote in message
> My callback func is defined in one module, and the callback is executed
> from another module which does not know in advance what module the
> callback func resides in.

If you passed the STRING 'my_function' to someone, then namespace lookup
would be necessary. if you passed a <function object>, no namespaces enter
into it.

Try this:

def foo(bar):
    pass
print type(foo)
print type('foo')

You are used to TCL it seems, where type(anything) is ultimately String.

Warren






More information about the Python-list mailing list