Browse Source

Clarify Python 3 stuff.

tags/v0.1
Ben Kurtovic 12 years ago
parent
commit
0a052f34fb
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      README.rst

+ 4
- 1
README.rst View File

@@ -29,7 +29,8 @@ Normal usage is rather straightforward (where ``text`` is page text)::
>>> wikicode = mwparserfromhell.parse(text) >>> wikicode = mwparserfromhell.parse(text)


``wikicode`` is a ``mwparserfromhell.wikicode.Wikicode`` object, which acts ``wikicode`` is a ``mwparserfromhell.wikicode.Wikicode`` object, which acts
like an ordinary unicode object with some extra methods. For example::
like an ordinary ``unicode`` object (or ``str`` on Python 3) with some extra
methods. For example::


>>> text = "I has a template! {{foo|bar|baz|eggs=spam}} See it?" >>> text = "I has a template! {{foo|bar|baz|eggs=spam}} See it?"
>>> wikicode = mwparserfromhell.parse(text) >>> wikicode = mwparserfromhell.parse(text)
@@ -96,6 +97,8 @@ saving the page!) by calling ``unicode()`` on it::
>>> text == code >>> text == code
True True


Likewise, in Python 3, use ``str(code)``.

Integration Integration
----------- -----------




Loading…
Cancel
Save