Fix a possible segfault from recursing too deep to get the repr of a list.

Closes issue #1096.
3 files changed