Thank you
(however in MATLAB ischar is the same as isstr)
but what if I don't know the name of module?
I.e. I have
def myfunc(param): ...
#where param can be both funcName or a function, and I want to obtain
both name and func, something like
if isinstance(param, basestring):
func, funcName = <something>, param
else: func, funcName = param, param.__name__
what should I type instead of <something>?
D.
On Mar 14, 7:06 pm, Alexander Schmolck <a.schmo...@gmail.comwrote:
"dmitrey" <open...@ukr.netwrites:
I can't find these via web serch
thank you in advance,
Dmitrey
str2func: getattr(some_module, 'f')
func2str: f.__name__
ischar: isinstance(x, basestring) and len(x) == 1
isfunc: callable(x) # is most likely to be what you want
'as