refactor: built-in name shadowing in jsonsplit signature

The `jsonsplit` function in `recipes.py` uses `type` as a parameter name, shadowing the Python built-in `type`. This can cause subtle bugs if the built-in is needed within the function scope or in nested calls, and it reduces code clarity for readers.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
This commit is contained in:
tomaioo 2026-07-06 23:10:15 -07:00
commit 4949933917

View file

@ -68,9 +68,9 @@ def parsedatetime(
def jsonsplit(
value: str, delimiter: str = ",", type: Callable[[str], object] = str
value: str, delimiter: str = ",", type_: Callable[[str], object] = str
) -> str:
"""
Convert a string like a,b,c into a JSON array ["a", "b", "c"]
"""
return json.dumps([type(s.strip()) for s in value.split(delimiter)])
return json.dumps([type_(s.strip()) for s in value.split(delimiter)])