浏览代码

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:


正在加载...
取消
保存