这段代码的作用是返回一个方法。首先判断method是否是可调用的,如果是则直接返回method。如果method是一个字符串,则通过getattr函数从spider对象中获取对应的方法,如果找不到则返回None

def _get_methodmethod spider if callablemethod return method if isinstancemethod str return getattrspider method None啥意思

原文地址: https://www.cveoy.top/t/topic/ikZP 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录