Skip to content

Commit aad5d96

Browse files
committed
mod: disable Mapping and Iterable checksums.
1 parent ba45f8f commit aad5d96

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
44

55
## [0.5.1] UNRELEASED
66
### Modified
7-
- Checksum can apply to `date`, `datetime`, `Mapping` or `Iterable` objects.
7+
- Checksum can apply to `date` and `datetime` objects.
88

99
## [0.5.0] 2026-03-05
1010
### Modified

src/pythonwrench/checksum.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737

3838
_CHECKSUM_REGISTRY = _FunctionRegistry[int]()
39+
_CHECKSUM_PROTOCOLS = False
3940

4041

4142
@overload
@@ -305,14 +306,15 @@ def checksum_slice(x: slice, **kwargs) -> int:
305306
return checksum_list_tuple((x.start, x.stop, x.step), **kwargs)
306307

307308

308-
@register_checksum_fn(Mapping, priority=-100)
309-
def checksum_mapping(x: Mapping, **kwargs) -> int:
310-
return _checksum_mapping(x, **kwargs)
309+
if _CHECKSUM_PROTOCOLS:
311310

311+
@register_checksum_fn(Mapping, priority=-100)
312+
def checksum_mapping(x: Mapping, **kwargs) -> int:
313+
return _checksum_mapping(x, **kwargs)
312314

313-
@register_checksum_fn(Iterable, priority=-200)
314-
def checksum_iterable(x: Iterable, **kwargs) -> int:
315-
return _checksum_iterable(x, **kwargs)
315+
@register_checksum_fn(Iterable, priority=-200)
316+
def checksum_iterable(x: Iterable, **kwargs) -> int:
317+
return _checksum_iterable(x, **kwargs)
316318

317319

318320
# Private functions

0 commit comments

Comments
 (0)