Skip to content

Commit 087f089

Browse files
authored
bpo-45557: Fix underscore_numbers in pprint.pprint(). (GH-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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy