cultcache-py: an extension is reported as an extension (a namedtuple was read as an array); boundary tests for the leaves

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-12 01:17:28 +02:00
commit ed30592ea7
2 changed files with 67 additions and 3 deletions

View file

@ -82,11 +82,11 @@ def _kind(raw: Any) -> str:
return "string"
if isinstance(raw, _BYTE_LIKE):
return "bytes"
if isinstance(raw, _ExtType): # a namedtuple, so before the arrays
return "ext"
if isinstance(raw, (_list, tuple)):
return "array"
if isinstance(raw, Mapping):
return "map"
return "ext" if isinstance(raw, _ExtType) else "other"
return "map" if isinstance(raw, Mapping) else "other"
def _refuse(what: str, found: str) -> NoReturn: