other ways to check for <type 'function'>?

elderic elderic at ish.de
Thu Nov 2 11:18:22 EST 2006


> > I just wanted to know if there was a keyword for functions, too.
> >
> > Then u could've done: type(f) is function
> > quite similar to: type(x) is int
>
> but why do you think you need that, when you have callable() ?  unless
> you're doing specialized stuff, there's really no reason to distinguish
> between function objects and other callables.
>
> </F>

I never said that I need anything - I merely asked for alternatives. =)
I'm pretty happy with the types-module or the callable() test.

Basically it's just for wrapping the creation of Tk-Buttons, etc.
They need a callback and in my process to learn I wanted to know about
the
possible options to test for that.

peace of mind. =)
elderic




More information about the Python-list mailing list