Skip to content

Commit

Permalink
Merge pull request #13648 from wjandrea/patch-1
Browse files Browse the repository at this point in the history
Show "maxlen" in deque repr
  • Loading branch information
Carreau committed Aug 30, 2022
2 parents 4e1c56c + 0a8b189 commit ae639fb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions IPython/lib/pretty.py
Expand Up @@ -908,6 +908,8 @@ def _deque_pprint(obj, p, cycle):
cls_ctor = CallExpression.factory(obj.__class__.__name__)
if cycle:
p.pretty(cls_ctor(RawText("...")))
elif obj.maxlen is not None:
p.pretty(cls_ctor(list(obj), maxlen=obj.maxlen))
else:
p.pretty(cls_ctor(list(obj)))

Expand Down

0 comments on commit ae639fb

Please sign in to comment.