Class inheritance in python

classes in python inherit
now inherit

import pymongo
class MongodbPipeline(object):

    def __init__(self, mongodbHost, mongodbPort,mongodbName, mongondbCollection):
        self.mongodbHost = mongodbHost
        self.mongodbPort = mongodbPort
        self.mongodbName = mongodbName
        self.mongodbCollection = mongondbCollection

    def from_crawler(cls, crawler):
        return cls(mongodbHost=crawler.settings.get("MONGODB_HOST"), mongodbPort=crawler.settings.get("MONGODB_PORT"),
                   mongodbName=crawler.settings.get("XIAOMIQUAN_DBNAME"),
                   mongondbCollection=crawler.settings.get("XIAOMIQUAN_COLLECTION"))

    def open_spider(self, spider):
        self.client = pymongo.MongoClient(self.mongodbHost, self.mongodbPort)
        self.mongodb = self.Client[self.mongodbName]
        self.db = self.mongodb[self.mongondbCollection]

these three methods, except that the dbname and dbcollection of the database are different, and the others are all the same. Now how to inherit the three methods in the subclass

this is written in the initialization of the subclass

def __init__(self, mongodbHost, mongodbPort, mongodbName, mongondbCollection):
        super(XiaoMiQuanPipeline, self).__init__(mongodbHost, mongodbPort, mongodbName, mongondbCollection)
Sep.16,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5b621-43bd5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5b621-43bd5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?