Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
umarbutler committed Mar 20, 2024
2 parents b1c3ab8 + 31d7e0e commit 09f9b8f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## Changelog 🔄
All notable changes to `persist-cache` will be documented here. This project adheres to [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.1] - 2024-03-20
### Fixed
- Fixed a bug causing `cache()` to raise a `TypeError` when attempting to cache a function call that contains an argument that is a list containing a dictionary ([#3](https://github.com/umarbutler/persist-cache/issues/3)) ([ec07874](https://github.com/umarbutler/persist-cache/commit/ec07874)).

## [0.3.0] - 2024-03-19
### Changed
- Ceased delimiting hashes and the length of the input with hyphens as the hashes already have a fixed size so there is no possibility of collision.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "persist-cache"
version = "0.3.0"
version = "0.3.1"
authors = [
{name="Umar Butler", email="umar@umar.au"},
]
Expand Down
2 changes: 1 addition & 1 deletion src/persist_cache/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def directly_msgpackable(data: Any) -> bool:
# - It is of a type specified by `ABSOLUTELY_DIRECTLY_MSGPACKABLE_TYPES`.
if (isinstance(data, str) and not any(data.startswith(str_signature) for str_signature in STR_SIGNATURES)) \
or isinstance(data, int) and -2**63 <= data <= 2**64-1 \
or (isinstance(data, list) and all(directly_msgpackable(d) for d in data) and (len(data) == 0 or data[0] not in LISTED_SIGNATURES)) \
or (isinstance(data, list) and all(directly_msgpackable(d) for d in data) and (len(data) == 0 or not isinstance(data[0], str) or data[0] not in LISTED_SIGNATURES)) \
or (isinstance(data, dict) and all(directly_msgpackable(k) and directly_msgpackable(v) for k, v in data.items())) \
or isinstance(data, ABSOLUTELY_DIRECTLY_MSGPACKABLE_TYPES):
return True
Expand Down

0 comments on commit 09f9b8f

Please sign in to comment.