lib.Types: Accept bare string in LoadTypes() #64

Merged
Jan Lindemann merged 1 commit from jan/feature/20260815-lib-types-accept-bare-string-in-loadtypes into master 2026-08-15 21:17:07 +02:00 AGit

lib.Types: Accept bare string in LoadTypes()

LoadTypes() declares mod_names as Iterable[str], so passing a single module name as a bare string is not caught at call time and the string is iterated character by character at load time, producing a ModuleNotFoundError for the first character instead of a clear error.

Normalize a bare string to a one-element list in init() and widen the annotation accordingly, so that both forms work.

#### lib.Types: Accept bare string in LoadTypes() LoadTypes() declares mod_names as Iterable[str], so passing a single module name as a bare string is not caught at call time and the string is iterated character by character at load time, producing a ModuleNotFoundError for the first character instead of a clear error. Normalize a bare string to a one-element list in __init__() and widen the annotation accordingly, so that both forms work.
lib.Types: Accept bare string in LoadTypes()
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m6s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m4s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m14s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m24s
CI / Packaging test (push) Successful in 0s
6308fb2690
LoadTypes() declares mod_names as Iterable[str], so passing a single
module name as a bare string is not caught at call time and the string
is iterated character by character at load time, producing a
ModuleNotFoundError for the first character instead of a clear error.

Normalize a bare string to a one-element list in __init__() and widen
the annotation accordingly, so that both forms work.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-08-15 21:08:54 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!64
No description provided.