Skip to content

pprint changes in 3.15.0b1 break some doctests #149615

@tim-one

Description

@tim-one

Bug report

Bug description:

Reported on d.p.o. here:

https://discuss.python.org/t/doctests-failing-with-python-3-15-0b1/107242

Changing pprint's output breaks doctests that rely on doctest's WYSIWYG guarantees. That's not good. While many people won't care, others will care a lot. For example, some entire books use doctest to ensure that the examples they publish work exactly as shown. It's a breaking change for them.

If a new output format is wanted, better to introduce it under a new name. Say, pprint.pprint2()'

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions