From daab08020e426a898a1451dc8f0c1aaab3cbc363 Mon Sep 17 00:00:00 2001 From: Kamil Cukrowski Date: Sun, 29 Sep 2024 22:35:12 +0200 Subject: [PATCH] improve constructing dict type --- src/clickdc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clickdc.py b/src/clickdc.py index a53f7fc..2749ad8 100644 --- a/src/clickdc.py +++ b/src/clickdc.py @@ -317,10 +317,10 @@ def make_default_class(default=default): return default() default = make_default_class - elif isinstance(default, list): + elif isinstance(default, (dict, list)): def make_default_list(default=default): - return list(default) + return type(default)(default) default = make_default_list # Problem: pyright complains that default or default_factory cannot be MISSING.