Skip to content

Commit

Permalink
improve constructing dict type
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamilcuk committed Sep 29, 2024
1 parent d5b5de6 commit daab080
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/clickdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit daab080

Please sign in to comment.