Преглед на файлове

Allow Wikicode objects to be pickled properly.

tags/v0.5
Ben Kurtovic преди 7 години
родител
ревизия
6ffdfa52ef
променени са 3 файла, в които са добавени 8 реда и са изтрити 0 реда
  1. +2
    -0
      CHANGELOG
  2. +3
    -0
      docs/changelog.rst
  3. +3
    -0
      mwparserfromhell/string_mixin.py

+ 2
- 0
CHANGELOG Целия файл

@@ -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 Целия файл

@@ -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 Целия файл

@@ -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:


Зареждане…
Отказ
Запис