Skip to content

Commit

Permalink
Merge pull request #12256 from eric-wieser/patch-3
Browse files Browse the repository at this point in the history
Keep trailing commas for tuple subclasses of length 1
  • Loading branch information
Carreau committed Apr 22, 2020
2 parents 48b4dd0 + b361f8e commit 198edd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion IPython/lib/pretty.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def inner(obj, p, cycle):
p.text(',')
p.breakable()
p.pretty(x)
if len(obj) == 1 and type(obj) is tuple:
if len(obj) == 1 and isinstance(obj, tuple):
# Special case for 1-item tuples.
p.text(',')
p.end_group(step, end)
Expand Down

0 comments on commit 198edd7

Please sign in to comment.