calculated.py 文件源码

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

项目:isf 作者: w3h 项目源码 文件源码
def __init__(self, depends_on, length, correction=None, encoder=ENC_INT_DEFAULT, fuzzable=False, name=None):
        '''
        :param depends_on: (name of) field we depend on
        :param length: length of the FieldIntProperty field (in bits)
        :type corrention: int or func(int) -> int
        :param correction: correction function, or value for the index
        :type encoder: :class:`~kitty.model.low_level.encoder.BitFieldEncoder`
        :param encoder: encoder for the field (default: ENC_INT_DEFAULT)
        :param fuzzable: is container fuzzable
        :param name: (unique) name of the container (default: None)
        '''
        if correction:
            if not callable(correction):
                if not isinstance(correction, types.IntType):
                    raise KittyException('correction must be int, function or None!')
        self._correction = correction
        bit_field = BitField(value=0, length=length, encoder=encoder)
        super(FieldIntProperty, self).__init__(depends_on=depends_on, bit_field=bit_field, calc_func=None, fuzzable=fuzzable, name=name)
        self.dependency_type = Calculated.FIELD_PROP_BASED
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号