whatstyle.py 文件源码

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

项目:whatstyle 作者: mikr 项目源码 文件源码
def use_startstyle(self, inlinestyletext):
        # type: (Optional[str]) -> None
        if inlinestyletext:
            # Transform YAML-like JSON
            # e.g. '{based_on_style: pep8, column_limit: 79}'
            # into '{"based_on_style": "pep8", "column_limit": 79}'
            # which can be parsed as JSON.
            inlinestyletext = re.sub(r'([a-zA-Z_]\w+)', r'"\1"', inlinestyletext)
            d = json.JSONDecoder().decode(inlinestyletext)  # type: ignore
            self.initial_style = style_make(d)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号