string.py 文件源码

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

项目:filters 作者: eflglobal 项目源码 文件源码
def __init__(
            self,
            max_bytes,
            truncate    = True,
            prefix      = '',
            encoding    = 'utf-8',
    ):
        # type: (int, bool, Text, Text) -> None
        """
        :param max_bytes:
            Max number of bytes to allow.

        :param truncate:
            Whether to truncate values that are too long.

            Set this to ``False`` to save system resources when you
            know that you will reject values that are too long.

        :param prefix:
            Prefix to apply to truncated values.

            Ignored when ``truncate`` is ``False``.

        :param encoding:
            The character encoding to check against.

            Note: This filter is optimized for UTF-8.
        """
        super(MaxBytes, self).__init__()

        self.encoding   = encoding
        self.max_bytes  = max_bytes
        self.prefix     = prefix
        self.truncate   = truncate
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号