This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author LewisGaul
Recipients LewisGaul, eric.smith, eric.snow, rhettinger, serhiy.storchaka
Date 2021-03-16.10:09:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1615889387.69.0.597737493394.issue43080@roundup.psfhosted.org>
In-reply-to
Content
> FWIW, we've not had a feature request for this ever, nor has there been a request for pprint to support attrs, nor any other hand-rolled class that implements methods similar to those generated by dataclasses.

I wouldn't expect core Python to support a 3rd party lib like attrs, but I fail to see what's so different between dataclasses, SimpleNamespace and namedtuple - all of these may be used for storing/modelling [nested] data, which then may be printed.

> AFAICT, this tracker issue wasn't motivated by a known use case; rather, it was "my PR was accepted for SimpleNamespace and thought dataclasses could be the next."

This issue is entirely motivated by a real-world example - I'm currently maintaining a private fork of the pprint module with support for dataclasses added. I'm assuming the reason this hasn't come up before is that dataclasses are relatively new (and plenty of users will still be on older versions of Python).

I was not the author of the issue that added support for SimpleNamespace, I just saw it and used it as an example of precedent.

> At some point, we need a modern redesign alternative to pprint.

I'm on board with this, but as Eric said there aren't currently any signs of this being worked on. In absence of a redesign, dataclass support seems like a natural extension to me.
History
Date User Action Args
2021-03-16 10:09:47LewisGaulsetrecipients: + LewisGaul, rhettinger, eric.smith, eric.snow, serhiy.storchaka
2021-03-16 10:09:47LewisGaulsetmessageid: <1615889387.69.0.597737493394.issue43080@roundup.psfhosted.org>
2021-03-16 10:09:47LewisGaullinkissue43080 messages
2021-03-16 10:09:47LewisGaulcreate