Skip to content

Commit

Permalink
Fix get_literal_expr for 1 element tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
zhPavel committed Jan 18, 2025
1 parent c3af48b commit 9575c65
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/adaptix/_internal/code_tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def _get_complex_literal_expr(obj: object) -> Optional[str]: # noqa: PLR0911
return _parenthesize("[]", obj)

if type(obj) is tuple:
if len(obj) == 1:
return f"({_provide_lit_expr(obj[0])}, )"
return _parenthesize("()", obj)

if type(obj) is set:
Expand Down

0 comments on commit 9575c65

Please sign in to comment.