threads.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:fandango 作者: tango-controls 项目源码 文件源码
def get_callable(key,executor=None):
        try:
            x = []
            if isinstance(key,basestring):
                trial(lambda:x.append(evalX(key)),lambda:x.append(None))
            return first(a for a in (
                key,
                x and x[0],
                isinstance(key,basestring) and getattr(executor,key,None), #key is a member of executor
                getattr(executor,'process',None), #executor is a process object
                executor, #executor is a callable
                #isinstance(key,basestring) and evalX(key), # key may be name of function
                ) if a and isCallable(a))
        except StopIteration,e:
            return None

    #@staticmethod
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号