From 7a1ab625faa7adec09f7478c395b63f47a8ab402 Mon Sep 17 00:00:00 2001 From: disqualifier Date: Mon, 6 Jul 2026 00:17:48 -0400 Subject: [PATCH] docs: widen FileContent to include bytearray (dpycache-3) _normalize and _to_file both already accept bytearray at runtime (isinstance((bytes, bytearray)), bytes(source) coercion in the dict path), but the FileContent Union only listed bytes - a typed consumer passing a bytearray gets spurious mypy arg-type/dict-item errors for input the code genuinely handles. Widen the Union to match actual behavior. Signed-off-by: disqualifier --- src/dpy_cache/dpy_cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dpy_cache/dpy_cache.py b/src/dpy_cache/dpy_cache.py index ab036fd..4ec767d 100644 --- a/src/dpy_cache/dpy_cache.py +++ b/src/dpy_cache/dpy_cache.py @@ -61,7 +61,7 @@ log = logging.getLogger(__name__) MAX_ATTACHMENTS_PER_MESSAGE = 10 -FileContent = Union[bytes, str, "os.PathLike[str]", discord.File] +FileContent = Union[bytes, bytearray, str, "os.PathLike[str]", discord.File] class DPYCacheError(Exception):