universal.py 文件源码

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

项目:AshsSDK 作者: thehappydinoa 项目源码 文件源码
def get_tokens(self, txtnodes):
        # A generator that yields ``(texttype, nodetext)`` tuples for a list
        # of "Text" nodes (interface to ``smartquotes.educate_tokens()``).

        texttype = {True: 'literal', # "literal" text is not changed:
                    False: 'plain'}
        for txtnode in txtnodes:
            nodetype = texttype[isinstance(txtnode.parent,
                                           self.literal_nodes)]
            yield (nodetype, txtnode.astext())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号