🐛 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:
Gabriel Luiz Freitas Almeida 2023-07-06 17:08:28 -03:00
commit b32e4ca8b9

View file

@ -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