소스 검색

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
No known key found for this signature in database 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*."""


불러오는 중...
취소
저장