bpo-45557: Fix underscore_numbers in pprint.pprint(). (GH-29129)

(cherry picked from commit 087f089e5e)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2021-10-21 14:16:59 -07:00 committed by GitHub
parent 98f157de12
commit 6b75ad5fd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -50,7 +50,8 @@ def pprint(object, stream=None, indent=1, width=80, depth=None, *,
"""Pretty-print a Python object to a stream [default is sys.stdout].""" """Pretty-print a Python object to a stream [default is sys.stdout]."""
printer = PrettyPrinter( printer = PrettyPrinter(
stream=stream, indent=indent, width=width, depth=depth, stream=stream, indent=indent, width=width, depth=depth,
compact=compact, sort_dicts=sort_dicts, underscore_numbers=False) compact=compact, sort_dicts=sort_dicts,
underscore_numbers=underscore_numbers)
printer.pprint(object) printer.pprint(object)
def pformat(object, indent=1, width=80, depth=None, *, def pformat(object, indent=1, width=80, depth=None, *,

View file

@ -0,0 +1,2 @@
pprint.pprint() now handles underscore_numbers correctly. Previously it was
always setting it to False.