Skip to content

Commit 087f089

Browse files
authored
bpo-45557: Fix underscore_numbers in pprint.pprint(). (pythonGH-29129)
1 parent 3754f55 commit 087f089

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Lib/pprint.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def pprint(object, stream=None, indent=1, width=80, depth=None, *,
5050
"""Pretty-print a Python object to a stream [default is sys.stdout]."""
5151
printer = PrettyPrinter(
5252
stream=stream, indent=indent, width=width, depth=depth,
53-
compact=compact, sort_dicts=sort_dicts, underscore_numbers=False)
53+
compact=compact, sort_dicts=sort_dicts,
54+
underscore_numbers=underscore_numbers)
5455
printer.pprint(object)
5556

5657
def pformat(object, indent=1, width=80, depth=None, *,
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pprint.pprint() now handles underscore_numbers correctly. Previously it was
2+
always setting it to False.

0 commit comments

Comments
 (0)