在Scrapy管道中,return super()。process_项表示什么?
我发现了一个粗糙的管道代码:在Scrapy管道中,return super()。process_项表示什么?,scrapy,scrapyd,Scrapy,Scrapyd,我发现了一个粗糙的管道代码: class SomeImagePipeline(ImagePipeline): .... .... def process_item(self, item, spider): return super(SomeImagesPipeline, self).process_item(item, spider) 什么是superSomeImagesPipeline、self.process\u itemitem、spider???
class SomeImagePipeline(ImagePipeline):
....
....
def process_item(self, item, spider):
return super(SomeImagesPipeline, self).process_item(item, spider)
什么是superSomeImagesPipeline、self.process\u itemitem、spider???根据super方法:
返回一个代理对象,该对象将方法调用委托给类型为的父类或同级类。这对于访问类中已重写的继承方法非常有用
因此,return superSomeImagesPipeline,self.process\u itemitem,spider调用基类即ImagePipeline的process\u item方法并返回其返回对象。super.process\u itemitem,spider与superSomeImagesPipeline,self.process\u itemitem,spider相同吗?