Merge pull request #71 from jiangpengcheng/tupple_bug

tupples which contain only 1 element need a comma
This commit is contained in:
R. Bernstein
2016-12-26 09:31:15 -05:00
committed by GitHub
3 changed files with 7 additions and 0 deletions

View File

@@ -5,3 +5,8 @@ def some_function():
def some_other_function():
some_variable, = some_function()
print(some_variable)
empty_tup = ()
one_item_tup = ("item1", )
one_item_tup_without_parentheses = "item",
many_items_tup = ("item1", "item2", "item3")

View File

@@ -924,6 +924,8 @@ class SourceWalker(GenericASTTraversal, object):
sep += ' '
pass
pass
if len(tup) == 1:
self.write(", ")
self.write(')')
def n_LOAD_CONST(self, node):