浏览代码

python3 supports unicode from __str__

the wikicode can be converted to unicode via "__unicode__" but
python3 support unicode through "__str__". This commimt allows
python3 code to convert a wikicode into a unicode via str([wikicode])
pull/259/head
digi-ark 4 年前
父节点
当前提交
78e7e5230b
找不到此签名对应的密钥 GPG 密钥 ID: 3FF1A33F0DE02DE2
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. +3
    -0
      mwparserfromhell/wikicode.py

+ 3
- 0
mwparserfromhell/wikicode.py 查看文件

@@ -51,6 +51,9 @@ class Wikicode(StringMixIn):
def __unicode__(self):
return "".join([str(node) for node in self.nodes])

def __str__(self):
return self.__unicode__()

@staticmethod
def _get_children(node, contexts=False, restrict=None, parent=None):
"""Iterate over all child :class:`.Node`\\ s of a given *node*."""


正在加载...
取消
保存