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 serhiy.storchaka
Recipients LewisGaul, eric.smith, eric.snow, rhettinger, serhiy.storchaka
Date 2021-01-31.15:07:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1612105640.33.0.111172787562.issue43080@roundup.psfhosted.org>
In-reply-to
Content
Good idea Eric, it should work.

But it can make the code of pprint potentially less flexible. Currently it uses a mapping which maps __repr__ to corresponding pprint implementation. Only exception is for dicts, for historical reasons. It potentially can allow to make pprint more general and support arbitrary types by registering some handlers. Since there is no standard implementation of __repr__ for namedtuples and dataclasses we cannot use them as keys, and need to hardcode checks for namedtuple and dataclass (and any other generated classes).

It is a minor objection. Perhaps practicality should beat purity in this case.
History
Date User Action Args
2021-01-31 15:07:20serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, eric.smith, eric.snow, LewisGaul
2021-01-31 15:07:20serhiy.storchakasetmessageid: <1612105640.33.0.111172787562.issue43080@roundup.psfhosted.org>
2021-01-31 15:07:20serhiy.storchakalinkissue43080 messages
2021-01-31 15:07:20serhiy.storchakacreate