On Sat, 29 May 2021, 20:24 André Roberge, <> wrote:

On Sat, May 29, 2021 at 3:25 PM Thomas Grainger <> wrote:

Thanks for the reminder.  Pytest takes care of traceback formatting for users.  Individual projects can of course do that. But I want to do the reverse: I want to limit what users of my projects will see in a traceback, without having them specify something in their code.

What I am interested in is having a project-agnostic standardised Python way to specify what to show to an end-user when an exception is raised.

Eg anyio sets __tracebackhide__ = __traceback_hide__ = True to remove internal frames from user Tracebacks
Do you have a specific link to this?  I have looked in the documentation as well as in a few modules (_core/ in particular) without seeing any reference to this. I am not interested in custom formatting for testing, which is something comparatively easy to do.