mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
bpo-43080: pprint for dataclass instances (GH-24389)
* Added pprint support for dataclass instances which don't have a custom __repr__.
This commit is contained in:
parent
695d47b51e
commit
11159d2c9d
5 changed files with 133 additions and 14 deletions
|
|
@ -28,6 +28,9 @@ Dictionaries are sorted by key before the display is computed.
|
|||
.. versionchanged:: 3.9
|
||||
Added support for pretty-printing :class:`types.SimpleNamespace`.
|
||||
|
||||
.. versionchanged:: 3.10
|
||||
Added support for pretty-printing :class:`dataclasses.dataclass`.
|
||||
|
||||
The :mod:`pprint` module defines one class:
|
||||
|
||||
.. First the implementation class:
|
||||
|
|
|
|||
|
|
@ -820,6 +820,12 @@ identification from `freedesktop.org os-release
|
|||
<https://www.freedesktop.org/software/systemd/man/os-release.html>`_ standard file.
|
||||
(Contributed by Christian Heimes in :issue:`28468`)
|
||||
|
||||
pprint
|
||||
------
|
||||
|
||||
:mod:`pprint` can now pretty-print :class:`dataclasses.dataclass` instances.
|
||||
(Contributed by Lewis Gaul in :issue:`43080`.)
|
||||
|
||||
py_compile
|
||||
----------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue