Sfoglia il codice sorgente

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 anni fa
parent
commit
78e7e5230b
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 3FF1A33F0DE02DE2
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. +3
    -0
      mwparserfromhell/wikicode.py

+ 3
- 0
mwparserfromhell/wikicode.py Vedi File

@@ -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*."""


Caricamento…
Annulla
Salva