prettier.py 文件源码

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

项目:python-devtools 作者: samuelcolvin 项目源码 文件源码
def __call__(self, value: Any, *, indent: int=0, indent_first: bool=False, highlight: bool=False):
        self._stream = io.StringIO()
        self._format(value, indent_current=indent, indent_first=indent_first)
        s = self._stream.getvalue()
        if highlight and pyg_lexer:
            # apparently highlight adds a trailing new line we don't want
            s = pygments.highlight(s, lexer=pyg_lexer, formatter=pyg_formatter).rstrip('\n')
        return s
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号