Skip to content

Commit 700ab63

Browse files
author
Hyojun Kang
committed
Prefer (item,) to tuple()
1 parent 684ee1a commit 700ab63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Nirum/Targets/Python.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ compileUnionTag source parentname typename' fields = do
202202
else toIndentedCodes (\n -> [qq|'{n}'|]) tagNames ",\n "
203203
hashTuple = if null tagNames
204204
then "self.__nirum_tag__"
205-
else [qq|tuple([{attributes}])|] :: T.Text
205+
else [qq|({attributes},)|] :: T.Text
206206
where
207207
attributes :: T.Text
208208
attributes = toIndentedCodes (\n -> [qq|self.{n}|]) tagNames ", "
@@ -393,7 +393,7 @@ compileTypeDeclaration src TypeDeclaration { typename = typename'
393393
toNamePair
394394
[name | Field name _ _ <- toList fields]
395395
",\n "
396-
hashTuple = [qq|tuple([{attributes}])|] :: T.Text
396+
hashTuple = [qq|({attributes},)|] :: T.Text
397397
where
398398
attributes = toIndentedCodes (\n -> [qq|self.{n}|]) fieldNames ","
399399
insertStandardImport "typing"

0 commit comments

Comments
 (0)