diff options
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | documentation/index.rst | 2 | ||||
-rw-r--r-- | six.py | 2 | ||||
-rw-r--r-- | test_six.py | 12 |
5 files changed, 19 insertions, 4 deletions
@@ -6,6 +6,9 @@ This file lists the changes in each six version. Development version ------------------- +- Issue #105 and pull request #58: Ensure `six.wraps` respects the *updated* and + *assigned* arguments. + - Issue #102: Add `raise_from` to abstract out Python 3's raise from syntax. - Issue #97: Optimize `six.iterbytes` on Python 2. @@ -9,8 +9,8 @@ notice must be retained.) Online documentation is at http://pythonhosted.org/six/. -Bugs can be reported to http://bitbucket.org/gutworth/six. The code can also be -found there. +Bugs can be reported to https://bitbucket.org/gutworth/six. The code can also +be found there. For questions about six or porting in general, email the python-porting mailing list: http://mail.python.org/mailman/listinfo/python-porting diff --git a/documentation/index.rst b/documentation/index.rst index 6b3ad1e..25e5345 100644 --- a/documentation/index.rst +++ b/documentation/index.rst @@ -18,7 +18,7 @@ tracker and code hosting is on `BitBucket <http://bitbucket.org/gutworth/six>`_. The name, "six", comes from the fact that 2*3 equals 6. Why not addition? Multiplication is more powerful, and, anyway, "five" has already been snatched -away by the Zope Five project. +away by the (admittedly now moribund) Zope Five project. Indices and tables @@ -747,7 +747,7 @@ if sys.version_info[0:2] < (3, 4): def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS, updated=functools.WRAPPER_UPDATES): def wrapper(f): - f = functools.wraps(wrapped)(f) + f = functools.wraps(wrapped, assigned, updated)(f) f.__wrapped__ = wrapped return f return wrapper diff --git a/test_six.py b/test_six.py index c023862..2a9ca74 100644 --- a/test_six.py +++ b/test_six.py @@ -702,6 +702,18 @@ def test_wraps(): assert k is original_k assert not hasattr(k, '__wrapped__') + def f(g, assign, update): + def w(): + return 42 + w.glue = {"foo" : "bar"} + return six.wraps(g, assign, update)(w) + k.glue = {"melon" : "egg"} + k.turnip = 43 + k = f(k, ["turnip"], ["glue"]) + assert k.__name__ == "w" + assert k.turnip == 43 + assert k.glue == {"melon" : "egg", "foo" : "bar"} + def test_add_metaclass(): class Meta(type): |