Fix cache_memoize to work with non-sequence data.

Review Request #11856 — Created Oct. 17, 2021 and submitted — Latest diff uploaded

Information

Djblets
release-2.x

Reviewers

The size checks in cache_memoize were causing it to fail when the
cached function was returning something other than a sequence. This
change fixes it so we only do those length checks for string types.

While I was in here I fixed up a few small style issues.

  • Used with a change that required this.
  • Ran unit tests.

Diff Revision 2

This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.

orig
1
2
3

Commits

First Last Summary ID Author
Fix cache_memoize to work with non-sequence data.
The size checks in cache_memoize were causing it to fail when the cached function was returning something other than a sequence. This change fixes it so we only do those length checks for string types. While I was in here I fixed up a few small style issues. Testing Done: - Used with a change that required this. - Ran unit tests.
b75ff82c039eb432e3112eb20cd71fdb2ded5e99 David Trowbridge
djblets/cache/backend.py
djblets/cache/tests/test_backend.py
Loading...