From de68bf5d79f4df17dd8989e0b1a85ed3af6ef330 2016-01-10 20:42:18 From: Jacob Niehus Date: 2016-01-10 20:42:18 Subject: [PATCH] Fix max_seq_length input to RepresentationPrinter max_seq_length is passed to RepresentationPrinter as a positional argument but the order is not correct for RepresentationPrinter's __init__. Pass max_seq_length as a keyword argument instead. --- diff --git a/IPython/lib/pretty.py b/IPython/lib/pretty.py index 028c3b2..1465a6a 100644 --- a/IPython/lib/pretty.py +++ b/IPython/lib/pretty.py @@ -124,7 +124,7 @@ def pretty(obj, verbose=False, max_width=79, newline='\n', max_seq_length=MAX_SE Pretty print the object's representation. """ stream = CUnicodeIO() - printer = RepresentationPrinter(stream, verbose, max_width, newline, max_seq_length) + printer = RepresentationPrinter(stream, verbose, max_width, newline, max_seq_length=max_seq_length) printer.pretty(obj) printer.flush() return stream.getvalue() @@ -134,7 +134,7 @@ def pprint(obj, verbose=False, max_width=79, newline='\n', max_seq_length=MAX_SE """ Like `pretty` but print to stdout. """ - printer = RepresentationPrinter(sys.stdout, verbose, max_width, newline, max_seq_length) + printer = RepresentationPrinter(sys.stdout, verbose, max_width, newline, max_seq_length=max_seq_length) printer.pretty(obj) printer.flush() sys.stdout.write(newline)