Browse Source

Allow Wikicode objects to be pickled properly.

tags/v0.5
Ben Kurtovic 7 years ago
parent
commit
6ffdfa52ef
3 changed files with 8 additions and 0 deletions
  1. +2
    -0
      CHANGELOG
  2. +3
    -0
      docs/changelog.rst
  3. +3
    -0
      mwparserfromhell/string_mixin.py

+ 2
- 0
CHANGELOG View File

@@ -2,6 +2,8 @@ v0.5 (unreleased):

- Made Template.remove(keep_field=True) behave more reasonably when the
parameter is already empty.
- Wikicode objects can now be pickled properly (fixed infinite recursion error
on incompletely-constructed StringMixIn subclasses).
- Fixed Wikicode.matches()'s behavior on iterables besides lists and tuples.
- Fixed len() sometimes raising ValueError on empty node lists.
- Fixed release script after changes to PyPI.


+ 3
- 0
docs/changelog.rst View File

@@ -9,6 +9,9 @@ Unreleased

- Made :meth:`Template.remove(keep_field=True) <.Template.remove>` behave more
reasonably when the parameter is already empty.
- :class:`.Wikicode` objects can now be pickled properly (fixed infinite
recursion error on incompletely-constructed :class:`.StringMixIn`
subclasses).
- Fixed :meth:`.Wikicode.matches`\ 's behavior on iterables besides lists and
tuples.
- Fixed ``len()`` sometimes raising ``ValueError`` on empty node lists.


+ 3
- 0
mwparserfromhell/string_mixin.py View File

@@ -108,6 +108,9 @@ class StringMixIn(object):
return str(item) in self.__unicode__()

def __getattr__(self, attr):
if not hasattr(str, attr):
raise AttributeError("{0!r} object has no attribute {1!r}".format(
type(self).__name__, attr))
return getattr(self.__unicode__(), attr)

if py3k:


Loading…
Cancel
Save