prettier.py 文件源码

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

项目:python-devtools 作者: samuelcolvin 项目源码 文件源码
def _format(self, value: Any, indent_current: int, indent_first: bool):
        if indent_first:
            self._stream.write(indent_current * self._c)

        value_repr = repr(value)
        if len(value_repr) <= self._simple_cutoff and not isinstance(value, collections.Generator):
            self._stream.write(value_repr)
        else:
            indent_new = indent_current + self._indent_step
            for t, func in self._type_lookup:
                if isinstance(value, t):
                    func(value, value_repr, indent_current, indent_new)
                    return
            self._format_raw(value, value_repr, indent_current, indent_new)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号