Skip to content
Advertisement

Python deque maxlen does not show

I have

JavaScript

result

JavaScript

enter image description here

but in book Fluent Python (2019), I see maxlen, like this

JavaScript

enter image description here

Is the different cause by version different?

Advertisement

Answer

This seems to be caused by IPython. If you do print(dq) or print(repr(dq)), you get your expected output, and same in a normal REPL.

JavaScript
JavaScript

Update: I’ve submitted a PR to IPython to fix the problem.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement