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

View file

@ -44,11 +44,15 @@ class LoadTypes(Types[T]): # export
def __init__(
self,
mod_names: Iterable[str],
mod_names: str | Iterable[str],
type_name_filter: str | None = None,
type_filter: Sequence[type[Any]] | None = None,
debug_level: int | None = None,
) -> None:
# -- Accept a single module name as well, so that the common
# case does not require wrapping the name in a list.
if isinstance(mod_names, str):
mod_names = [mod_names]
if debug_level is None:
val = os.getenv('JW_LOG_LEVEL_LOAD_TYPES')
if val is not None: