指令的意义

时间:2014-08-23 15:24:25

标签: python sql sqlmap

我在sqlmap项目https://github.com/sqlmapproject/sqlmap/blob/master/lib/core/datatype.py中找到了这段代码

我不理解调用构造函数AttribDict.__init__(self)

的含义
class InjectionDict(AttribDict):
    def __init__(self):
        AttribDict.__init__(self)

        self.place = None
        self.parameter = None
        self.ptype = None
        self.prefix = None
        self.suffix = None
        self.clause = None

        # data is a dict with various stype, each which is a dict with
        # all the information specific for that stype
        self.data = AttribDict()

        # conf is a dict which stores current snapshot of important
        # options used during detection
        self.conf = AttribDict()

        self.dbms = None
        self.dbms_version = None
        self.os = None

1 个答案:

答案 0 :(得分:1)

InjectionDict类是一个子类,它所包含的基类是AttribDict。这就是语法的含义

class InjectionDict(AttribDict):

然后在InjectDict的{​​{1}}方法中,他们首先调用基类的__init__方法,然后再执行子类的其余部分{{ 1}}工作。

__init__

有关此行为的详细说明,请参阅this post