🐛 fix(util.py): improve type formatting in format_dict function
The format_dict function now properly handles different variations of list types by removing unnecessary characters from the type string. This improves the consistency and accuracy of the type formatting in the function.
This commit is contained in:
parent
4616ca68bd
commit
b32e4ca8b9
1 changed files with 5 additions and 1 deletions
|
|
@ -243,7 +243,11 @@ def format_dict(d, name: Optional[str] = None):
|
|||
|
||||
# Check for list type
|
||||
if "List" in _type or "Sequence" in _type or "Set" in _type:
|
||||
_type = _type.replace("List[", "")[:-1]
|
||||
_type = (
|
||||
_type.replace("List[", "")
|
||||
.replace("Sequence[", "")
|
||||
.replace("Set[", "")[:-1]
|
||||
)
|
||||
value["list"] = True
|
||||
else:
|
||||
value["list"] = False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue