You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
plone.memoize.view.memoize cannot handle function arguments which are unhashable types.
E.g.:
When adding this example to view.rst:
$ git diff
diff --git a/plone/memoize/view.rst b/plone/memoize/view.rst
index 45de49c..bb92b48 100644
--- a/plone/memoize/view.rst
+++ b/plone/memoize/view.rst
@@ -89,6 +89,9 @@ We support memoization of multiple signatures as long as all signature values ar
>>> print(msg.getMsg('J.D.', **{'raise':'roofbeams'}))
J.D.: goodbye cruel world! raise--roofbeams
+ >>> print(msg.getMsg('J.D.', lower=['shields', 'engines']))
+ J.D.: goodbye cruel world! lower--['shields', 'engines']
+
We can alter data underneath, but nothing changes::
>>> msg.txt1 = 'sound and fury'
Running the tests with tox run -e py311 fails with::
File "plone.memoize/.tox/py311/lib/python3.11/site-packages/plone/memoize/view.rst", line 92, in view.rst
Failed example:
print(msg.getMsg('J.D.', lower=['shields', 'engines']))
Exception raised:
Traceback (most recent call last):
File "~/.pyenv/versions/3.11.2/lib/python3.11/doctest.py", line 1351, in __run
exec(compile(example.source, filename, "single",
File "<doctest view.rst[23]>", line 1, in <module>
print(msg.getMsg('J.D.', lower=['shields', 'engines']))
File "plone.memoize/.tox/py311/lib/python3.11/site-packages/plone/memoize/view.py", line 47, in memogetter
frozenset(kwargs.items()),
TypeError: unhashable type: 'list'
Likewise with dicts:
Adding:
$ git diff
diff --git a/plone/memoize/view.rst b/plone/memoize/view.rst
index 45de49c..8589dd3 100644
--- a/plone/memoize/view.rst
+++ b/plone/memoize/view.rst
@@ -89,6 +89,9 @@ We support memoization of multiple signatures as long as all signature values ar
>>> print(msg.getMsg('J.D.', **{'raise':'roofbeams'}))
J.D.: goodbye cruel world! raise--roofbeams
+ >>> print(msg.getMsg('J.D.', actions={'open': ['gates']}))
+ J.D.: goodbye cruel world! actions--{'open': ['gates']}
+
We can alter data underneath, but nothing changes::
>>> msg.txt1 = 'sound and fury'
tox run -e py311 Results in:
File "plone.memoize/.tox/py311/lib/python3.11/site-packages/plone/memoize/view.rst", line 92, in view.rst
Failed example:
print(msg.getMsg('J.D.', actions={'open': ['gates']}))
Exception raised:
Traceback (most recent call last):
File "~/.pyenv/versions/3.11.2/lib/python3.11/doctest.py", line 1351, in __run
exec(compile(example.source, filename, "single",
File "<doctest view.rst[23]>", line 1, in <module>
print(msg.getMsg('J.D.', actions={'open': ['gates']}))
File "plone.memoize/.tox/py311/lib/python3.11/site-packages/plone/memoize/view.py", line 47, in memogetter
frozenset(kwargs.items()),
TypeError: unhashable type: 'dict'
The text was updated successfully, but these errors were encountered:
plone.memoize.view.memoize cannot handle function arguments which are unhashable types.
E.g.:
When adding this example to
view.rst
:Running the tests with
tox run -e py311
fails with::Likewise with dicts:
Adding:
tox run -e py311
Results in:The text was updated successfully, but these errors were encountered: