ソースを参照

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 3年前
コミット
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*."""


読み込み中…
キャンセル
保存