Sfoglia il codice sorgente

Allow Wikicode objects to be pickled properly.

tags/v0.5
Ben Kurtovic 7 anni fa
parent
commit
6ffdfa52ef
3 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. +2
    -0
      CHANGELOG
  2. +3
    -0
      docs/changelog.rst
  3. +3
    -0
      mwparserfromhell/string_mixin.py

+ 2
- 0
CHANGELOG Vedi 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 Vedi 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 Vedi 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:


Caricamento…
Annulla
Salva